tabs.modules.routes.ts 1.4 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253
  1. import { NgModule } from '@angular/core';
  2. import { mapToCanActivate, RouterModule, Routes } from '@angular/router';
  3. import { AnthorhomeComponent } from './anthorhome/anthorhome.component';
  4. import { AuthGuard } from './auth.guard';
  5. import { HomeComponent } from './home/home.component';
  6. import { LiveReviewComponent } from './live-review/live-review.component';
  7. import { MyComponent } from './my/my.component';
  8. import { NoticeComponent } from './notice/notice.component';
  9. import { RankingComponent } from './ranking/ranking.component';
  10. import { SpaceComponent } from './space/space.component';
  11. const routes: Routes = [
  12. {
  13. path: '',
  14. redirectTo:'home',
  15. pathMatch: "full",
  16. },
  17. {
  18. path: 'home', //首页
  19. canActivate: mapToCanActivate([AuthGuard]),
  20. component: HomeComponent,
  21. },
  22. {
  23. path: 'anthirhome', //主播端首页
  24. canActivate: mapToCanActivate([AuthGuard]),
  25. component: AnthorhomeComponent,
  26. },
  27. {
  28. path: 'notice', //消息
  29. component: NoticeComponent,
  30. },
  31. {
  32. path: 'live-review', //预览直播
  33. component: LiveReviewComponent,
  34. },
  35. {
  36. path: 'ranking', //排名
  37. component: RankingComponent,
  38. },
  39. {
  40. path: 'my', //我的
  41. component: MyComponent,
  42. },
  43. {
  44. path: 'space', //朋友圈
  45. component: SpaceComponent,
  46. },
  47. ]
  48. @NgModule({
  49. imports: [RouterModule.forChild(routes)],
  50. exports: [RouterModule],
  51. })
  52. export class TabsRoutingModule { }