Guest User

Untitled

a guest
Mar 17th, 2018
99
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.73 KB | None | 0 0
  1. import { NgModule } from '@angular/core';
  2. import { CommonModule } from '@angular/common';
  3. import { Routes, RouterModule } from '@angular/router';
  4. import { CrisisListComponent } from './crisis-list.component';
  5. import { HeroListComponent } from './hero-list.component';
  6. import { NotFoundComponent } from './not-found.component';
  7.  
  8. const appRoutes: Routes = [
  9. {path: 'crisis-center', component: CrisisListComponent},
  10. {path: 'heroes', component: HeroListComponent},
  11. {path: '', redirectTo: '/heroes', pathMatch: 'full'},
  12. {path: '*', component: NotFoundComponent}
  13. ];
  14.  
  15. @NgModule({
  16. imports: [
  17. CommonModule,
  18. RouterModule.forRoot(appRoutes)
  19. ],
  20. exports: [RouterModule] // 这里在exports里面导出
  21. })
  22. export class AppRoutingModule { }
Add Comment
Please, Sign In to add comment