app-routing.module.ts 862 B

12345678910111213141516171819202122232425262728293031323334353637
  1. import { NgModule } from '@angular/core';
  2. import { Routes, RouterModule } from '@angular/router';
  3. import { SelectivePreloadingStrategyService } from '../CX/services/selective-preloading-strategy.service';
  4. import { AuthGuard } from './auth.guard';
  5. const routes: Routes = [
  6. {
  7. path: '',
  8. pathMatch: 'full',
  9. redirectTo: 'page',
  10. },
  11. {
  12. path: 'page',
  13. canActivate: [AuthGuard],
  14. loadChildren: () => import('./pages/pages.module').then(m => m.PagesModule)
  15. },
  16. {
  17. path: 'login',
  18. canActivate: [AuthGuard],
  19. loadChildren: () => import('./login/login.module').then(m => m.LoginModule)
  20. }
  21. ];
  22. @NgModule({
  23. imports: [
  24. RouterModule.forRoot(
  25. routes,
  26. {
  27. useHash: true,
  28. preloadingStrategy: SelectivePreloadingStrategyService
  29. }
  30. )],
  31. exports: [RouterModule]
  32. })
  33. export class AppRoutingModule { }