Skip to content

Standalone Routing

With standalone components, routing is simpler. Use provideRouter() and loadComponent().

bootstrapApplication(AppComponent, {
providers: [provideRouter(routes)]
});
// Lazy load standalone components
const routes: Routes = [{
path: 'products',
loadComponent: () => import('./products.component').then(m => m.ProductsComponent)
}];

Standalone routing eliminates module-based lazy loading complexity.”