Created
June 24, 2016 06:53
-
-
Save sonicoder86/ff34ecabdcbf2569734064b421069b56 to your computer and use it in GitHub Desktop.
Upgrading to the new Angular 2 router - part 2
This file contains 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
// routes.ts | |
import { provideRouter, RouterConfig } from '@angular/router'; | |
import { HeroesComponent } from './components/heroes/heroes.component'; | |
import { HeroDetailComponent } from './components/hero-detail/hero-detail.component'; | |
export const appRoutes: RouterConfig = [ | |
{ path: '', component: HeroesComponent, terminal: true }, | |
{ path: 'detail/:id', component: HeroDetailComponent } | |
]; | |
export const APP_ROUTER_PROVIDER = provideRouter(appRoutes); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment