tabs-routing.module.ts 1.1 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344
  1. import { NgModule } from '@angular/core';
  2. import { RouterModule, Routes } from '@angular/router';
  3. import { TabsPage } from './tabs.page';
  4. import { AuthGuard } from 'src/app/service/auth.guard';
  5. const routes: Routes = [
  6. {
  7. path: '',
  8. component: TabsPage,
  9. children: [
  10. {
  11. path: 'tab1',
  12. loadChildren: () => import('../tab1/tab1.module').then(m => m.Tab1PageModule),
  13. // canActivate: [AuthGuard],
  14. },
  15. {
  16. path: 'tab2',
  17. loadChildren: () => import('../tab2/tab2.module').then(m => m.Tab2PageModule),
  18. canActivate: [AuthGuard],
  19. },
  20. {
  21. path: 'tab3',
  22. loadChildren: () => import('../tab3/tab3.module').then(m => m.Tab3PageModule),
  23. canActivate: [AuthGuard],
  24. },
  25. {
  26. path: 'tab4',
  27. loadChildren: () => import('../tab4/tab4.module').then(m => m.Tab4PageModule),
  28. canActivate: [AuthGuard],
  29. },
  30. {
  31. path: '',
  32. redirectTo: 'tab1',
  33. pathMatch: 'full'
  34. }
  35. ]
  36. },
  37. ];
  38. @NgModule({
  39. imports: [RouterModule.forChild(routes)],
  40. exports: [RouterModule],
  41. })
  42. export class TabsPageRoutingModule {}