RouteParams

export class RouteParams

exported from angular2/router defined in angular2/src/router/instruction.ts (line 3)

RouteParams is an immutable map of parameters for the given route based on the url matcher and optional parameters for that route.

You can inject RouteParams into the constructor of a component to use it.

Example

import {Component} from 'angular2/core'; import {bootstrap} from 'angular2/platform/browser'; import {Router, ROUTER_DIRECTIVES, ROUTER_PROVIDERS, RouteConfig} from 'angular2/router'; @Component({directives: [ROUTER_DIRECTIVES]}) @RouteConfig([ {path: '/user/:id', component: UserCmp, as: 'UserCmp'}, ]) class AppCmp {} @Component({ template: 'user: {{id}}' }) class UserCmp { id: string; constructor(params: RouteParams) { this.id = params.get('id'); } } bootstrap(AppCmp, ROUTER_PROVIDERS);

Constructor

constructor(params: {[key: string]: string})

Not Yet Documented

Members

params : {[key: string]: string}

Not Yet Documented

get(param: string) : string

Not Yet Documented