Skip to content

Instantly share code, notes, and snippets.

@sidthesloth92
Created April 3, 2016 15:22
Show Gist options
  • Save sidthesloth92/94bc78ad45e425b1f8fe4443cba75b05 to your computer and use it in GitHub Desktop.
Save sidthesloth92/94bc78ad45e425b1f8fe4443cba75b05 to your computer and use it in GitHub Desktop.
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