Is there a way to dynamically load module scripts?
I have 2 JS files:
module1.js
(function() {
var mod = angular.module('module1', []);
....
})();
This is the second one:
module2.js
(function() {
var mod = angular.module('module2', ['module1']);
....
})();
I am looking for a method to load module1.js dynamically when it is needed in module2.js.
Is there any way to associate modules names with their source URLs? For example:
angular.registerModuleSource('module1', 'http://myhost.com/app/module1.js')
angular.registerModuleSource('module2', 'http://myhost.com/app/module2.js')