When you build a app modularized what do you inject into submodules? Only
those things that are used there but not added at the top level, or do you
inject everything that is explicitly used in that module, even if it is
already loaded up in the main module.
angular
.module('myApp', ['myApp.core', 'myApp.user', 'myApp.routing',
'myApp.frontPage']);
angular
.module('myApp.frontPage', []).run(appRun);
appRun.$inject = ['routerHelper']; //this is provided in the myApp.routing
module.
function appRun(routerHelper) {
routerHelper.configureStates(getStates());
};
function getStates() {
return [
//states omitted
]
};
Here there really isn't need to inject *myApp.routing *but it would
certainly make *myApp.frontPage* more self contained.
This also matters when unit testing because you would always have to load
up *myApp *to test *myApp.frontPage*.
Do you feel we should always load up the whole app in unit test, or just
for integration and e2e tests?
--
You received this message because you are subscribed to the Google Groups
"AngularJS" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
To post to this group, send email to [email protected].
Visit this group at https://groups.google.com/group/angular.
For more options, visit https://groups.google.com/d/optout.