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: Provider[]

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 })
]);

Functions

Generated using TypeDoc