The UI-Router providers, for use in your application bootstrap
This is a StateBuilder.builder function for ngModule lazy loading in Angular.
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 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)
.
A state that has a ngModule
var decl = {
ngModule: () => System.import('./childModule.ts')
}
would build a state with a lazyLoad
function like:
import { loadNgModule } from "@uirouter/angular";
var decl = {
lazyLoad: loadNgModule(() => System.import('./childModule.ts')
}
If the state has both a ngModule:
and a lazyLoad
, then the lazyLoad
is run first.
var decl = {
lazyLoad: () => System.import('third-party-library'),
ngModule: () => System.import('./childModule.ts')
}
would build a state with a lazyLoad
function like:
import { loadNgModule } from "@uirouter/angular";
var decl = {
lazyLoad: () => System.import('third-party-library')
.then(() => loadNgModule(() => System.import('./childModule.ts'))
}
This is a StateBuilder.builder function for Angular views
.
This is a StateBuilder.builder function for Angular views
.
When the StateBuilder builds a [[State]] object from a raw StateDeclaration, this builder
handles the views
property with logic specific to @uirouter/angular.
If no views: {}
property exists on the StateDeclaration, then it creates the views
object and
applies the state-level configuration to a view named $default
.
This is a factory function for a UIRouter instance
This is a factory function for a UIRouter instance
Creates a UIRouter instance and configures it for Angular, then invokes router bootstrap.
This function is used as an Angular useFactory
Provider.
Generated using TypeDoc
UI-Router for Angular (v2+)
Getting started:
@uirouter/angular
"@uirouter/angular"
import {StateRegistry} from "@uirouter/angular";
export let state1: Ng2StateDeclaration = { name: 'state1', component: State1Component, url: '/one' } export let state2: Ng2StateDeclaration = { name: 'state2', component: State2Component, url: '/two' }
NgModule
s.@ NgModule({ imports: [ SharedModule, UIRouterModule.forChild({ states: [state1, state2 ] }) ], declarations: [ State1Component, State2Component, ] }) export class MyFeatureModule {}
NgModule
<ui-view></ui-view>
viewport to your root component.@ NgModule({ imports: [ BrowserModule, UIRouterModule.forRoot({ states: [ homeState ] }), MyFeatureModule, ], declarations: [ HomeComponent ] bootstrap: [ UIView ] }) class RootAppModule {} browserPlatformDynamic.bootstrapModule(RootAppModule);
import {UIRouter} from "@uirouter/angular"; @ Injectable() export class MyUIRouterConfig { // Constructor is injectable constructor(uiRouter: UIRouter) { uiRouter.urlMatcherFactory.type('datetime', myDateTimeParamType); } }