Returns a function which lazy loads a nested module
This is primarily used by the ng2LazyLoadBuilder when processing Ng2StateDeclaration.loadChildren.
It could also be used manually as a [[StateDeclaration.lazyLoad]] property to lazy load an NgModule
and its state(s).
Using import()
and named export of HomeModule
declare var System;
var futureState = {
name: 'home.**',
url: '/home',
lazyLoad: loadNgModule(() => import('./home/home.module').then(result => result.HomeModule))
}
Using a path (string) to the module
var futureState = {
name: 'home.**',
url: '/home',
lazyLoad: loadNgModule('./home/home.module#HomeModule')
}
a path (string) to the NgModule to load.
Or a function which loads the NgModule code which should
return a reference to the NgModule
class being loaded (or a Promise
for it).
A function which takes a transition, which:
Generated using TypeDoc
A function that returns an NgModule, or a promise for an NgModule
Example:
export function loadFooModule() { return import('../foo/foo.module').then(result => result.FooModule); }