I\'m using meteor + angular. My intention is to add more dependencies after the app bootstrap (This is because the package is the one handling the bootstrapping at the start and
The only method that I've seen that works is replacing the angular.module
function with your own function returning the module you used to bootstrap your app.
var myApp = angular.module('myApp', []);
angular.module = function() {
return myApp;
}
So that all modules that are registered afterwards are actually being registered in your myApp
module.
This method combined with the one you describe in the question (using providers like $controllerProvider
) will allow you to add "modules" after angular.bootstrap
.
Demo
See this jsfiddle for a demo: https://jsfiddle.net/josketres/aw3L38r4/
Drawbacks
config
blocks of the modules that are added after angular.bootstrap
will not be called. Maybe there's a way to fix this, but I haven't found it.angular.module
feels like a "dirty hack".