2016-08-17 13:31:40 -07:00
|
|
|
// #docplaster
|
|
|
|
// #docregion , heroes
|
2016-08-14 13:54:33 -05:00
|
|
|
import { ModuleWithProviders } from '@angular/core';
|
2016-08-09 17:38:25 +01:00
|
|
|
import { Routes, RouterModule } from '@angular/router';
|
2016-06-19 00:20:38 -04:00
|
|
|
|
2016-08-17 13:31:40 -07:00
|
|
|
// #enddocregion heroes
|
|
|
|
import { DashboardComponent } from './dashboard.component';
|
|
|
|
// #docregion heroes
|
|
|
|
import { HeroesComponent } from './heroes.component';
|
|
|
|
// #enddocregion heroes
|
|
|
|
import { HeroDetailComponent } from './hero-detail.component';
|
|
|
|
// #docregion heroes
|
2016-06-19 00:20:38 -04:00
|
|
|
|
2016-08-09 17:38:25 +01:00
|
|
|
const appRoutes: Routes = [
|
2016-08-17 13:31:40 -07:00
|
|
|
// #enddocregion heroes
|
|
|
|
// #docregion redirect
|
2016-06-19 00:20:38 -04:00
|
|
|
{
|
|
|
|
path: '',
|
|
|
|
redirectTo: '/dashboard',
|
2016-07-01 00:11:33 +02:00
|
|
|
pathMatch: 'full'
|
2016-06-19 00:20:38 -04:00
|
|
|
},
|
2016-08-17 13:31:40 -07:00
|
|
|
// #enddocregion redirect
|
|
|
|
// #docregion dashboard
|
2016-06-19 00:20:38 -04:00
|
|
|
{
|
|
|
|
path: 'dashboard',
|
|
|
|
component: DashboardComponent
|
|
|
|
},
|
2016-08-17 13:31:40 -07:00
|
|
|
// #enddocregion dashboard
|
|
|
|
// #docregion hero-detail
|
2016-06-19 00:20:38 -04:00
|
|
|
{
|
|
|
|
path: 'detail/:id',
|
|
|
|
component: HeroDetailComponent
|
|
|
|
},
|
2016-08-17 13:31:40 -07:00
|
|
|
// #enddocregion hero-detail
|
|
|
|
// #docregion heroes
|
2016-06-19 00:20:38 -04:00
|
|
|
{
|
|
|
|
path: 'heroes',
|
|
|
|
component: HeroesComponent
|
|
|
|
}
|
|
|
|
];
|
2016-08-17 13:31:40 -07:00
|
|
|
// #enddocregion heroes
|
2016-06-19 00:20:38 -04:00
|
|
|
|
2016-08-14 13:54:33 -05:00
|
|
|
export const routing: ModuleWithProviders = RouterModule.forRoot(appRoutes);
|