Angular Router: Preloading Modules
Lazy loading speeds up our application load timeby splitting it into multiple bundles, and loading them on demand. We designed the router to make lazy loading transparent , so you can opt in and opt out of lazy loading with ease.
The issue with lazy loading, of course, is that when the user navigates to the lazy-loadable section of the application, the router will have to fetch the required modules from the server, which can take time.
To fix this problem we have added support for preloading. Now the router can preload lazy-loadable modules in the background while the user is interacting with our application.
This article is based on the Angular 2 Router book, which you can find here https://leanpub.com/router . The book goes beyond a how-to-get-started guide and talks about the router in depth. The mental model, design constraints, and the subtleties of the API-everything is covered. If you enjoy the article, check out the book!