October 2017
Intermediate to advanced
280 pages
6h 50m
English
As we have already mentioned, in the perfect scenario, we would want to download only the minimum set of resources that the user needs at a given time. For instance, if the user visits the home page, we'd want to download only the bundle that corresponds to the home module (that is, HomeModule).
Later, when the user navigates to dev-add, the router will need to download AddDeveloperModule. Although, this way, the user will consume network bandwidth only for the assets they use, the user experience will be far from perfect because of the slowdown that happens while navigating to as yet unvisited pages.
In order to handle this problem, we can add a route preloading strategy:
import {RouterModule, PreloadAllModules, ...Read now
Unlock full access