Created
April 3, 2016 15:22
-
-
Save sidthesloth92/94bc78ad45e425b1f8fe4443cba75b05 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import {Component} from 'angular2/core'; | |
import {RouteConfig, ROUTER_DIRECTIVES} from 'angular2/router'; | |
import {ChildStateOneComponent} from "./child-state-one.component"; | |
import {ChildStateTwoComponent} from "./child-state-two.component"; | |
@Component({ | |
selector: 'child-state-root', | |
template : `This is the child state root page | |
<nav> | |
<a [routerLink]="['ChildStateOne']">Child State One</a> | |
<a [routerLink]="['ChildStateTwo']">Child State Two</a> | |
</nav> | |
<router-outlet></router-outlet>`, | |
directives : ROUTER_DIRECTIVES | |
}) | |
@RouteConfig([ | |
{ | |
path : '/child-state-one', | |
name : 'ChildStateOne', | |
component : ChildStateOneComponent, | |
useAsDefault : true | |
}, | |
{ | |
path : '/child-state-two', | |
name : 'ChildStateTwo', | |
component: ChildStateTwoComponent | |
} | |
]) | |
export class ChildStatesRootComponent {} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment