Lazy loading

Lazy loading delays downloading the code of part of the application until it is needed, for example when visiting a route. It reduces the size of the initial bundle and speeds up the first render. In Angular, it is declared with loadComponent or loadChildren.

Example

{ path: 'admin', loadComponent: () => import('./admin').then(m => m.Admin) }

Related concepts

The whole glossary