LoadChildrenCallback

From Get docs
< @angular/routerAngular/docs/8/api/router/loadchildrencallback


LoadChildrenCallback

type-alias

A function that is called to resolve a collection of lazy-loaded routes.

See more...

type LoadChildrenCallback = () => Type<any> | NgModuleFactory<any> | Observable<Type<any>> | Promise<NgModuleFactory<any> | Type<any> | any>;

See also

  • Route#loadChildren.

Description

Often this function will be implemented using an ES dynamic import() expression. For example:

[{
  path: 'lazy',
  loadChildren: () => import('./lazy-route/lazy.module').then(mod => mod.LazyModule),
}];

This function must match the form above: an arrow function of the form () => import('...').then(mod => mod.MODULE).


© 2010–2020 Google, Inc.
Licensed under the Creative Commons Attribution License 4.0.
https://v8.angular.io/api/router/LoadChildrenCallback