A
A
Abc Edc2015-02-14 12:08:00
Angular
Abc Edc, 2015-02-14 12:08:00

How to more correctly organize storage by entities in angular?

I decided to make the structure
index.html
js
...app.js
.../user
..........userController.js
..........userModule.js
.../feed
. .........feedController.js
..........feedModule.js
Is it possible to somehow connect the controller to the module and the modules themselves are already in the index, or do you need both?
And when then to write in the index NGapp = Which of the many modules?

Answer the question

In order to leave comments, you need to log in

1 answer(s)
S
Sergey, 2015-02-14
@gleber1

Either use a module manager (RequireJS, CommonJS, etc.) or include all files in index.html (some kind of gulp-inject). In production, you should have one file either per application or one file per module.
If you want to organize lazy module loading (although I doubt that this is a large application) - there are separate solutions for this. + In angular 1.5, they seem to be planning to add support for lazy loading of modules at the $inject service level.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question