IT:AD:Angular.JS:HowTo:Lazy Loading
Summary
No two ways about it – Angular.JS prior to v2, where it is rumoured that Lazy loading will be built in – sucks at lazy loading resources.
And yet, lazy loading is fundamental to the development of large scale apps.
Notes
The stumbling blocks are:
- Can't register components against the module after the app has been bootstrapped, you get an error saying the dependency is not defined.
The questions are:
- what technology to use for lazy loading (that's easy: IT:AD:Require.JS is probably the best).
- how can we register a component against a module after it's been boostrapped,
- note: a common proposal to this has been to use Providers for everything…