Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- import { NgModule } from "@angular/core";
- import { RouterModule, Routes } from "@angular/router";
- import { NoDeviceGuard } from "./nodevice-guard.service";
- import { NoDeviceComponent } from "./core/components/no-device/no-device.component";
- import { SettingsPageComponent } from "./settings/containers/settings-page/settings-page.component";
- import { DevicesPageComponent } from "./devices/containers/devices-page/devices-page.component";
- import { AdminGuard } from "./admin-guard.service";
- import { UserGuard } from "./auth/user-guard.service";
- const routes: Routes = [
- { path: "", redirectTo: "/login", pathMatch: "full" },
- {
- path: "devices",
- component: DevicesPageComponent,
- canActivate: [NoDeviceGuard]
- },
- {
- path: "apks",
- loadChildren: () => import('./apks/apks.module').then(m => m.ApksModule),
- canActivate: [NoDeviceGuard]
- },
- {
- path: "contexts",
- loadChildren: () => import('./contexts/contexts.module').then(m => m.ContextsModule),
- canActivate: [NoDeviceGuard, UserGuard]
- },
- {
- path: "tools",
- loadChildren: () => import('./tools/tools.module').then(m => m.ToolsModule),
- canActivate: [NoDeviceGuard, UserGuard]
- },
- {
- path: "shell",
- loadChildren: () => import('./shell/shell.module').then(m => m.ShellModule),
- canActivate: [NoDeviceGuard]
- },
- {
- path: "content-providers",
- loadChildren: () => import('./content-providers/content-providers.module').then(m => m.ContentProvidersModule),
- canActivate: [NoDeviceGuard]
- },
- {
- path: "mode-selector",
- loadChildren: () => import('./mode-selector/mode-selector.module').then(m => m.ModeSelectorModule),
- canActivate: [NoDeviceGuard]
- },
- {
- path: "list-jobs",
- loadChildren: () => import('./list-jobs/list-jobs.module').then(m => m.ListJobsModule),
- canActivate: [NoDeviceGuard]
- },
- {
- path: "settings",
- component: SettingsPageComponent,
- canActivate: [NoDeviceGuard]
- },
- {
- path: "users",
- loadChildren: () => import('./users/users.module').then(m => m.UsersModule),
- canActivate: [AdminGuard]
- },
- { path: "noDevice/:target", component: NoDeviceComponent }
- ];
- @NgModule({
- imports: [RouterModule.forRoot(routes, { useHash: true })],
- exports: [RouterModule]
- })
- export class AppRoutingModule {}
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement