Modularize AngularJS application : one or multiple AngularJS modules? Modularize AngularJS application : one or multiple AngularJS modules? angularjs angularjs

Modularize AngularJS application : one or multiple AngularJS modules?


We have a similar structure (on a very large app) to the one you are proposing here, except don't have controllers,services and the like bundled up into single .js files. Instead we just separate our concerns with views, services and the like all bundled into a single module. So each meaningful component might looks like:

/my-component    - i-do-something.js    - a-view.html    - a-view-that-is-a-child.html    - a-view-ctrl.js    - index.js //the thing that creates a module and returns it    / tests         - i-do-something-spec.js         - a-view-ctrl-spec.js

This is all bundled up into a single app module (named for our org). Then a simple boot module angular.bootstrap(['app'])s the whole thing.We use browserify to compile all this stuff and it has worked nicely so far.