Angular › Standalone Components
How do standalone components handle lazy loading differently from NgModule based lazy loading?
IntermediateAnswer
Instead of lazy loading an entire feature module, you can lazy load a single standalone component directly in your route configuration using loadComponent, letting you split your app into smaller, more granular pieces without needing a wrapping NgModule just for routing purposes.
const routes: Routes = [
{ path: 'settings', loadComponent: () => import('./settings.component').then(m => m.SettingsComponent) }
];Real-world example A settings page's code is only downloaded the first time a user actually navigates there, using loadComponent to lazy load that single standalone component directly, without needing a dedicated SettingsModule just to enable lazy loading.