Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to structure AngularJS-Rails project

What should be the file structure of an Angularjs + Rails project. I am doing the angular part(never work with rails before) in this project. Previously i combined php frameworks(ci/laravel) with angular and the file structure was like following.

ngProjectFolder
-scripts
-views
-index.html
-backend(ci/laravel project folder)
--application
--index.php

I also worked on such file structure where angular files are put into php frameworks assets and view folders. e.g.

phpProjectFolder (ci/laravel)
-assets
--js
---angularjs controller and other js files
--css
-controller(php)
-model(php)
-view
--angular view files

None of these file structure are exact(unnecessary folder are not shown here). I just wanted show an overview.

I will use Angular routing system.

Which file structure should i use and why? Is there any security issues? Need some advice. thanks in advance.

like image 783
Fahad Billah Avatar asked Nov 23 '14 10:11

Fahad Billah


People also ask

Can I use node js with AngularJS?

Both can be combined to create isomorphic web applications. NodeJS is the cross-platform and a run-time environment for Javascript applications. AngularJS is an open-source platform for web application development which is maintained by Google. In order to use NodeJS, you need to install it into your system.

What is scaffolding in AngularJS?

Scaffolding in Visual Studio allows you to generate a component that contains a DevExtreme UI component and a data service for the UI component. You can scaffold the DataGrid, TreeList, and Form. Scaffolding has the following requirements: Visual Studio 2017 and later.

What is the structure of angular?

The main building blocks of Angular are modules, components, metadata, templates, data binding, services, directives, and dependency injection.


1 Answers

Similar to the PHP project you mentioned, you can use:

RailsProjectFolder
-app
--assets
---javascript
----angularjs
like image 133
seajoshc Avatar answered Oct 15 '22 03:10

seajoshc