Problem Statement
Explain lazy loading in Angular and how to configure it.
Explanation
Lazy loading splits the app into feature bundles that load on demand, reducing initial bundle size and improving startup. Configure routes with loadChildren and place feature routes in the feature module’s routing file.
Code Solution
SolutionRead Only
// app-routing.module.ts
const routes: Routes = [
{ path: 'admin', loadChildren: () => import('./admin/admin.module').then(m => m.AdminModule) }
];Practice Sets
This question appears in the following practice sets: