Skip to content

Instantly share code, notes, and snippets.

@sonicoder86
Created June 24, 2016 06:53
Show Gist options
  • Save sonicoder86/ff34ecabdcbf2569734064b421069b56 to your computer and use it in GitHub Desktop.
Save sonicoder86/ff34ecabdcbf2569734064b421069b56 to your computer and use it in GitHub Desktop.
Upgrading to the new Angular 2 router - part 2
// 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