Loading topic
provideRouter, read TypeScript import and export statements, and run ng build. It explains the mechanism under every lazy route: the dynamic import() expression. Once you understand what it does, `loadComp5 min readng build. It also assumes you know that import() returns a Promise. The chapter covers loadComponent: what it does, how the router uses it, how to verify the result, and the errors people c6 min readprovideRouter, read TypeScript import and export statements, and run ng build. Earlier chapters showed that a dynamic import() creates a separate chunk, and that loadComponent lazy loads one component. 5 min readprovideRouter, and read an ng build report. It also assumes you have seen loadChildren return a Routes array. Here you learn how to give a lazy feature area its own services, where those services live at runtime, an6 min readprovideRouter, and that you know how loadComponent and loadChildren create separate chunks. It also assumes you can read the file list that ng build prints. Here you will see what the router does with those lazy chunks after the first p7 min readloadComponent and loadChildren create lazy chunks and how withPreloading(PreloadAllModules) is configured. It covers the case where PreloadAllModules fetches too much, and how to write a PreloadingStrategy that chooses which routes to fetch.6 min readprovideRouter, and read ng build output. It also assumes you know how loadChildren creates a lazy chunk, which earlier chapters covered. Here you will use the canMatch guard to decide whether a lazy route applies be7 min readloadComponent and loadChildren with a Routes array. You should also know what an NgModule is: a class decorated with @NgModule that lists declarations, imports, exports, and providers.6 min readloadComponent or loadChildren correctly and still ship the code in the main bundle. A single stray static import is enough. The router doesn't warn you about this. The build output is where you find out.8 min readloadComponent or loadChildren route and read the output of ng build. Here you will learn how a correct-looking lazy route can still end up in the main bundle, how to notice that, and how to fix it. You will also see the runtime problems that lazy ro8 min read