When the StateBuilder builds a [[State]] object from a raw StateDeclaration, this builder
decorates the lazyLoad property for states that have a [[Ng2StateDeclaration.ngModule]] declaration.
If the state has a [[Ng2StateDeclaration.ngModule]], it will create a lazyLoad function
that in turn calls loadNgModule(loadNgModuleFn).
This is a StateBuilder.builder function for ngModule lazy loading in Angular.
When the StateBuilder builds a [[State]] object from a raw StateDeclaration, this builder decorates the
lazyLoadproperty for states that have a [[Ng2StateDeclaration.ngModule]] declaration.If the state has a [[Ng2StateDeclaration.ngModule]], it will create a
lazyLoadfunction that in turn callsloadNgModule(loadNgModuleFn).Example:
A state that has a
ngModulevar decl = { ngModule: () => import('./childModule.ts') }would build a state with a
lazyLoadfunction like:import { loadNgModule } from "@uirouter/angular"; var decl = { lazyLoad: loadNgModule(() => import('./childModule.ts') }If the state has both a
ngModule:and alazyLoad, then thelazyLoadis run first.Example:
var decl = { lazyLoad: () => import('third-party-library'), ngModule: () => import('./childModule.ts') }would build a state with a
lazyLoadfunction like:import { loadNgModule } from "@uirouter/angular"; var decl = { lazyLoad: () => import('third-party-library') .then(() => loadNgModule(() => import('./childModule.ts')) }