
Angular Cookbook
By :

We're already familiar with how to lazy load different feature modules upon navigation. Although sometimes, you might want to preload subsequent routes to make the next route navigation instantaneous or might even want to use a custom preloading strategy based on your application's business logic. In this recipe, you'll learn about the PreloadAllModules
strategy and will also implement a custom strategy to cherry-pick which modules should be preloaded.
The project that we are going to work with resides in chapter07/start_here/route-preloading-strategies
inside the cloned repository:
npm install
to install the dependencies of the project. ng serve -o
.This should open the app in a new browser tab and you should see something like the following:
Figure 7.10 – route-preloading-strategies app running on http://localhost:4200...