Angular · Middle · Question 28 of 75
How do you lazy-load a standalone component for a route?
- ✓Correct answer:
{ path: 'settings', loadComponent: () => import('./settings').then((m) => m.Settings) } - 2
{ path: 'settings', component: lazy(Settings) } - 3Add
lazy: trueto the component decorator
Explanation
The bundler puts the component in its own chunk, downloaded on first navigation. For a group of routes use loadChildren that returns a Routes array.