Advertisement
Guest User

Untitled

a guest
Mar 31st, 2020
83
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 2.30 KB | None | 0 0
  1. import { NgModule } from "@angular/core";
  2. import { RouterModule, Routes } from "@angular/router";
  3. import { NoDeviceGuard } from "./nodevice-guard.service";
  4. import { NoDeviceComponent } from "./core/components/no-device/no-device.component";
  5. import { SettingsPageComponent } from "./settings/containers/settings-page/settings-page.component";
  6. import { DevicesPageComponent } from "./devices/containers/devices-page/devices-page.component";
  7. import { AdminGuard } from "./admin-guard.service";
  8. import { UserGuard } from "./auth/user-guard.service";
  9.  
  10. const routes: Routes = [
  11. { path: "", redirectTo: "/login", pathMatch: "full" },
  12. {
  13. path: "devices",
  14. component: DevicesPageComponent,
  15. canActivate: [NoDeviceGuard]
  16. },
  17. {
  18. path: "apks",
  19. loadChildren: () => import('./apks/apks.module').then(m => m.ApksModule),
  20. canActivate: [NoDeviceGuard]
  21. },
  22. {
  23. path: "contexts",
  24. loadChildren: () => import('./contexts/contexts.module').then(m => m.ContextsModule),
  25. canActivate: [NoDeviceGuard, UserGuard]
  26. },
  27. {
  28. path: "tools",
  29. loadChildren: () => import('./tools/tools.module').then(m => m.ToolsModule),
  30. canActivate: [NoDeviceGuard, UserGuard]
  31. },
  32. {
  33. path: "shell",
  34. loadChildren: () => import('./shell/shell.module').then(m => m.ShellModule),
  35. canActivate: [NoDeviceGuard]
  36. },
  37. {
  38. path: "content-providers",
  39. loadChildren: () => import('./content-providers/content-providers.module').then(m => m.ContentProvidersModule),
  40. canActivate: [NoDeviceGuard]
  41. },
  42. {
  43. path: "mode-selector",
  44. loadChildren: () => import('./mode-selector/mode-selector.module').then(m => m.ModeSelectorModule),
  45. canActivate: [NoDeviceGuard]
  46. },
  47. {
  48. path: "list-jobs",
  49. loadChildren: () => import('./list-jobs/list-jobs.module').then(m => m.ListJobsModule),
  50. canActivate: [NoDeviceGuard]
  51. },
  52. {
  53. path: "settings",
  54. component: SettingsPageComponent,
  55. canActivate: [NoDeviceGuard]
  56. },
  57. {
  58. path: "users",
  59. loadChildren: () => import('./users/users.module').then(m => m.UsersModule),
  60. canActivate: [AdminGuard]
  61. },
  62. { path: "noDevice/:target", component: NoDeviceComponent }
  63. ];
  64.  
  65. @NgModule({
  66. imports: [RouterModule.forRoot(routes, { useHash: true })],
  67. exports: [RouterModule]
  68. })
  69. export class AppRoutingModule {}
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement