ng2 | UI-Router
Options
All
  • Public
  • Public/Protected
  • All
Menu

External module ng2

UI-Router for Angular 2

For the quick start repository, please see http://github.com/ui-router/quickstart-ng2

Getting started:

  • Use npm. Add a dependency on latest ui-router-ng2
  • Import UI-Router classes directly from "ui-router-ng2"
import {StateRegistry} from "ui-router-ng2";
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 })
]);

Index

Variables

UIROUTER_PROVIDERS: ProviderLike[]

The UI-Router providers, for use in your application bootstrap

The UI-Router providers, for use in your application bootstrap

example

bootstrap(UIView, [
    ...UIROUTER_PROVIDERS,
    ...HTTP_PROVIDERS,
    provide(UIRouterConfig, { useClass: MyUIRouterConfig })
]);
id: number
splitOnEquals: (Anonymous function)
splitOnHash: (Anonymous function)
splitOnQuestionMark: (Anonymous function)

Functions

Generated using TypeDoc