Angular · Senior · Question 29 of 75
How do you preload lazy routes after the initial page has loaded?
- ✓Correct answer:
provideRouter(routes, withPreloading(PreloadAllModules))or a custom preloading strategy - 2Change every
loadComponenttocomponent - 3Add
<link rel="prefetch">for each route manually
Explanation
Preloading keeps the initial bundle small and still makes later navigation instant. A custom strategy can preload only routes flagged in data, or only on fast connections.