I'm thinking about migrating a large web application 'SPA' I wrote in angular 1 to angular 2,
The application contains hundreds of modules and this number can go way up because the community can upload new modules, so loading every module for every section up front is out of the question.
In AngularJs 1.x, I managed to programmatically load (Lazy loading using $compile) and unload (using $destroy) scopes and views "modules", and everything's working smoothly..
So, my question is how to achieve this in Angular 2 (currently using rc1) ? How to dynamically load modules, and unload them when the user is done ?
Probably you can use DynamicComponentLoader for your requirement.
It supports conditional Loading of multiple components too.
For more referrence you can follow This Plunker too.
You can load multiple components whenever required and unload them too.
Hope this helps.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With