The UI-Router providers, for use in your application bootstrap
This is a StateBuilder.builder function for angular2 views
.
This is a StateBuilder.builder function for angular2 views
.
When the StateBuilder builds a State object from a raw StateDeclaration, this builder
handles the views
property with logic specific to ui-router-ng2.
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
.
Generated using TypeDoc
UI-Router for Angular 2
For the quick start repository, please see http://github.com/ui-router/quickstart-ng2
Getting started:
ui-router-ng2
"ui-router-ng2"
import {StateRegistry} from "ui-router-ng2";
directives:
array.<ui-view></ui-view>
viewport to your root component.import {UIRouter} from "ui-router-ng2"; import {INITIAL_STATES} from "./app.states"; @ Injectable() export class MyUIRouterConfig { configure(uiRouter: UIRouter) { INITIAL_STATES.forEach(function(state) { uiRouter.stateRegistry.register(state)); }); } }
import {provide} from "@angular/core"; import {bootstrap} from 'angular2/platform/browser'; import {UIRouterConfig, UiView, UIROUTER_PROVIDERS} from "ui-router-ng2"; import {MyUIRouterConfig} from "./router.config"; bootstrap(UiView, [ ...UIROUTER_PROVIDERS, provide(UIRouterConfig, { useClass: MyUIRouterConfig }) ]);