Instruction

export class Instruction

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

Instruction is a tree of ComponentInstructions with all the information needed to transition each component in the app to a given route, including all auxiliary routes.

Instructions can be created using Router, and can be used to perform route changes with Router.

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([ {...}, ]) class AppCmp { constructor(router: Router) { var instruction = router.generate(['/MyRoute']); router.navigateByInstruction(instruction); } } bootstrap(AppCmp, ROUTER_PROVIDERS);

Members

component : ComponentInstruction

Not Yet Documented

child : Instruction

Not Yet Documented

auxInstruction : {[key: string]: Instruction}

Not Yet Documented

urlPath : string

Not Yet Documented

urlParams : string[]

Not Yet Documented

specificity : string

Not Yet Documented

resolveComponent() : Promise<ComponentInstruction>

Not Yet Documented

toRootUrl() : string

converts the instruction into a URL string

toUrlQuery() : string

Not Yet Documented

replaceChild(child: Instruction) : Instruction

Returns a new instruction that shares the state of the existing instruction, but with the given child Instruction replacing the existing child.

toUrlPath() : string

If the final URL for the instruction is ``

toLinkUrl() : string

Not Yet Documented