Lazy loading Angular 13+ modules without the deprecated compiler

Published

I’ve worked extensively with loading and instantiating Angular modules. (without the router)

But now with Angular 13 I’m seeing deprecations for the usual compiler tools to instantiate an NgModule:

enter image description here

Looking deeper
The V13 change where ViewContainerRef now has the factory included makes dynamic components 1 step easier. However, regarding ViewContainerRef.createComponent() the documentation states:

Deprecated Angular no longer requires component factories to
dynamically create components. Use different signature of the
createComponent method, which allows passing Component class directly.

So what are the new directions for these tasks in Angular 13+?

Source: Angular Questions

Published
Categorized as angular, lazy-initialization, lazy-loading Tagged , ,

Answers

Leave a Reply

This site uses Akismet to reduce spam. Learn how your comment data is processed.

Still Have Questions?


Our dedicated development team is here for you!

We can help you find answers to your question for as low as 5$.

Contact Us
faq