A function that returns an NgModule, or a promise for an NgModule
export function loadFooModule() {
return System.import('../foo/foo.module').then(result => result.FooModule);
}
A string or a function which lazy loads a module
If a string, should conform to the Angular Router loadChildren
string.
var ngModuleToLoad = './foo/foo.module#FooModule'
For functions, see: ModuleTypeCallback
Apply the UI-Router Modules found in the lazy loaded module.
Apply the UI-Router Modules found in the lazy loaded module.
Apply the Lazy Loaded NgModule's newly created Injector to the right state in the state tree.
Lazy loading uses a placeholder state which is removed (and replaced) after the module is loaded. The NgModule should include a state with the same name as the placeholder.
Find the newly loaded state with the same name as the placeholder state.
The NgModule's Injector (and ComponentFactoryResolver) will be added to that state.
The Injector/Factory are used when creating Components for the replacement
state and all its children.
Returns the module factory that can be used to instantiate a module
Returns the module factory that can be used to instantiate a module
For strings this:
For a Type
Returns a function which lazy loads a nested module
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 System.import()
and named export of HomeModule
declare var System;
var futureState = {
name: 'home.**',
url: '/home',
lazyLoad: loadNgModule(() => System.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:
Returns the new dependency injection values from the Child Injector
Returns the new dependency injection values from the Child Injector
When a DI token is defined as multi: true, the child injector can add new values for the token.
This function returns the values added by the child injector, and excludes all values from the parent injector.
Generated using TypeDoc
Core classes and interfaces
The classes and interfaces that are core to ui-router and do not belong to a more specific subsystem (such as resolve).