Angular FAQ: Top Questions
24. What is lazy loading in Angular?
Lazy loading is a technique to load feature modules only when they are required. It improves application load time and performance.
const routes: Routes = [
{ path: 'admin', loadChildren: () => import('./admin/admin.module').then(m => m.AdminModule) }
];
- Use in large apps to reduce initial bundle size.
- Each lazy-loaded module should have its own routing module.