In this post you’ll learn how to Lazy Load an Angular module. Lazy loading means that our code isn’t downloaded by the browser until it’s needed.

What is Lazy Loading?

For instance, if I login to /admin I would get a “chunk” of JavaScript code specifically for the Admin dashboard. Similarly, if I load /shop I would expect another “chunk” of JavaScript specifically for just the Shop!

If I visited the Admin panel and navigated to Shop, the code related to the Shop would be lazy loaded and “injected” into the browser (in simple terms) for us to use the Shop module.

#angular #javascript #web-development

Lazy-Loading Angular Modules (Ivy and Async Await)
5.65 GEEK