Lazy Loading Modules

Lazy loading in Angular allows loading modules only when needed.

Snippet:

const routes: Routes = [{ path: "feature", loadChildren: () => import("./feature/feature.module").then(m => m.FeatureModule) }];

Example:

const routes: Routes = [{ path: "admin", loadChildren: () => import("./admin/admin.module").then(m => m.AdminModule) }];