b0354f5f5ec27f88b8e9d7097a137eacec3acde5
[examples/angular-tour-of-heroes] / src / app / app-routing.module.ts
1 import { NgModule } from '@angular/core';
2 import { RouterModule, Routes } from '@angular/router';
3 import { HeroesComponent } from './heroes/heroes.component';
4 import { DashboardComponent } from './dashboard/dashboard.component';
5
6
7 const routes : Routes = [
8   { path: '', redirectTo: 'dashboard', pathMatch: 'full'},
9   { path: 'heroes', component: HeroesComponent },
10   { path: 'dashboard', component: DashboardComponent }
11 ];
12
13
14 @NgModule({
15   imports: [ RouterModule.forRoot(routes) ],
16   exports: [ RouterModule ]
17 })
18 export class AppRoutingModule { }