Answer the question
In order to leave comments, you need to log in
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
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 questionAsk a Question
731 491 924 answers to any question