Lazy loading, preloading and routing performance
Learn Lazy loading, preloading and routing performance (Module 10 · Angular Routing, Angular) with worked examples, diagrams and interview questions. Free on JavaSchoolLab.
Load code only when needed • By default all code ships in one big file. Lazy loading splits the app into chunks that the browser downloads only when the user visits that route, like ordering food only when you are hungry instead of carrying the whole menu. • Lazy loading components : loadComponent: () => import('./x').then(m => m.XComponent) . • Lazy loading route configurations : loadChildren: () => import('./admin/admin.routes').then(m => m.ADMIN_ROUTES) loads a whole feature's route tree.