Last active
April 2, 2016 19:04
-
-
Save sidthesloth92/93fa24ee1738ac8ed4fa28898e930f1e 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 {ViewOneComponent} from "./viewone.component"; | |
import {ViewTwoComponent} from "./viewtwo.component"; | |
@Component({ | |
selector : 'my-app', | |
template : `<nav> | |
<a [routerLink]="['ViewOne']">View One</a> | |
<a [routerLink]="['ViewTwo']">View Two</a> | |
</nav> | |
<router-outlet></router-outlet>`, | |
directives : ROUTER_DIRECTIVES | |
}) | |
@RouteConfig([ | |
{ | |
path : '/view-one', | |
name : 'ViewOne', | |
component : ViewOneComponent, | |
useAsDefault : true | |
}, | |
{ | |
path : '/view-two', | |
name : 'ViewTwo', | |
component: ViewTwoComponent | |
}]) | |
export class AppComponent {} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment