You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository was archived by the owner on Apr 12, 2024. It is now read-only.
If you call 1 more than once, you wipe out your original module. If you call 2 first, you get an error (module undefined).
Right now, a problem exists with lazy-loading and asynchronous loading of assets. But what if you could simply supplement a module definition (instead of throwing errors or overriding it).
Lets say I want to load module.js and controller.js and directive.js asynchronously. But if anything other than module loads first, we get errors. If we add a dependency list in the other files, then the preceeding files are blown away.
Why don't we let you load in your crap in whatever order you want (even declaring the dependencies late) and only start throwing errors if these methods are called AFTER angular.bootstrap()?
This may not make lazy-loading perfect, but it would enable us to perform async loading with greater flexibility. Or perhaps async loading is not beneficial enough to bother with this?
The text was updated successfully, but these errors were encountered:
What do you mean of "redefine" an module? If we define a module with different dependency the second time after bootstrap, will the directives from new dependency work immediatly?
So... right now, you must do this:
angular.module('myModule', ['dependency1', 'dependency2'])
angular.module('myModule')
If you call 1 more than once, you wipe out your original module. If you call 2 first, you get an error (module undefined).
Right now, a problem exists with lazy-loading and asynchronous loading of assets. But what if you could simply supplement a module definition (instead of throwing errors or overriding it).
Lets say I want to load
module.js
andcontroller.js
anddirective.js
asynchronously. But if anything other than module loads first, we get errors. If we add a dependency list in the other files, then the preceeding files are blown away.Why don't we let you load in your crap in whatever order you want (even declaring the dependencies late) and only start throwing errors if these methods are called AFTER
angular.bootstrap()
?This may not make lazy-loading perfect, but it would enable us to perform async loading with greater flexibility. Or perhaps async loading is not beneficial enough to bother with this?
The text was updated successfully, but these errors were encountered: