Skip to content
Snippets Groups Projects
app-routing.module.ts 2.5 KiB
Newer Older
  • Learn to ignore specific revisions
  • import { AboutComponent } from './app-root/about/about.component';
    
    import { NgModule } from '@angular/core';
    import { Routes, RouterModule } from '@angular/router';
    
    import {AppRootComponent} from "./app-root/app-root.component";
    
    import {LoginComponent} from "./app-root/login/login.component";
    import {SysCheckStarterComponent} from "./app-root/sys-check-starter/sys-check-starter.component";
    
    import {AdminStarterComponent} from "./app-root/admin-starter/admin-starter.component";
    import {CodeInputComponent} from "./app-root/code-input/code-input.component";
    
    mechtelm's avatar
    mechtelm committed
    import {DirectLoginActivateGuard, RouteDispatcherActivateGuard} from "./app-routing-guards";
    
    mechtelm's avatar
    mechtelm committed
    import {TestStarterComponent} from "./app-root/test-starter/test-starter.component";
    import {RouteDispatcherComponent} from "./app-root/route-dispatcher/route-dispatcher.component";
    
    mechtelm's avatar
    mechtelm committed
      {
        path: '',
        redirectTo: 'r/route-dispatcher',
        pathMatch: 'full'
      },
    
      {path: 'r', component: AppRootComponent,
        children: [
    
    mechtelm's avatar
    mechtelm committed
          {path: '', redirectTo: 'route-dispatcher', pathMatch: 'full'},
    
          {path: 'login', redirectTo: 'route-dispatcher', pathMatch: 'full'},
    
          {path: 'login/:returnTo', component: LoginComponent},
          {path: 'about', component: AboutComponent},
          {path: 'check-starter', component: SysCheckStarterComponent},
    
    mechtelm's avatar
    mechtelm committed
          {path: 'test-starter', component: TestStarterComponent},
    
          {path: 'admin-starter', component: AdminStarterComponent},
    
    mechtelm's avatar
    mechtelm committed
          {path: 'route-dispatcher', component: RouteDispatcherComponent, canActivate: [RouteDispatcherActivateGuard]},
          {path: 'code-input', component: CodeInputComponent}
    
    Martin Mechtel's avatar
    Martin Mechtel committed
      {path: 'about', component: AboutComponent},
    
      {path: 'check', loadChildren: () => import('./sys-check/sys-check.module').then(m => m.SysCheckModule)},
      {path: 'admin', loadChildren: () => import('./workspace-admin/workspace.module').then(m => m.WorkspaceModule)},
      {path: 'superadmin', loadChildren: () => import('./superadmin/superadmin.module').then(m => m.SuperadminModule)},
      {path: 'wsmonitor', loadChildren: () => import('./workspace-monitor/workspace-monitor.module').then(m => m.WorkspaceMonitorModule)},
    
    mechtelm's avatar
    mechtelm committed
      {path: 't', loadChildren: () => import('./test-controller/test-controller.module').then(m => m.TestControllerModule)},
    
    mechtelm's avatar
    mechtelm committed
      {path: '**', component: RouteDispatcherComponent, canActivate: [DirectLoginActivateGuard]}
    
    ];
    
    @NgModule({
      imports: [RouterModule.forRoot(routes)],
    
    mechtelm's avatar
    mechtelm committed
      exports: [RouterModule],
    
    mechtelm's avatar
    mechtelm committed
      providers: [RouteDispatcherActivateGuard, DirectLoginActivateGuard]