How can I load module script dynamically.
I have 2 JS files:
module1.js
(function() {
var mod = angular.module('module1', []);
....
})();
This is the second:
module2.js
(function() {
var mod = angular.module('module2', ['module1']);
....
})();
I want to load the module1.js dynamically when it is required in module2.js.
There are any way to "map" modules name with the source URL? Something like this:
angular.registerModuleSource('module1', 'http://myhost.com/app/module1.js')
angular.registerModuleSource('module2', 'http://myhost.com/app/module2.js')