This is the codeAbility Sharing Platform! Learn more about the codeAbility Sharing Platform.

Skip to content
Snippets Groups Projects
app-routing.module.ts 1.82 KiB
Newer Older
import { NgModule } from '@angular/core';
import { RouterModule } from '@angular/router';
Michael Breu's avatar
Michael Breu committed

import { errorRoute } from './layouts/error/error.route';
import { navbarRoute } from './layouts/navbar/navbar.route';
import { DEBUG_INFO_ENABLED } from 'app/app.constants';
Michael Breu's avatar
Michael Breu committed
import { Authority } from 'app/config/authority.constants';
import { DatapolicyComponent } from './layouts/datapolicy/datapolicy.component';
Lukas Kaltenbrunner's avatar
Lukas Kaltenbrunner committed

Michael Breu's avatar
Michael Breu committed
import { UserRouteAccessService } from 'app/core/auth/user-route-access.service';
Michael Breu's avatar
Michael Breu committed
@NgModule({
  imports: [
    RouterModule.forRoot(
      [
        {
          path: 'admin',
          data: {
            authorities: [Authority.ADMIN],
          },
          canActivate: [UserRouteAccessService],
          loadChildren: () => import('./admin/admin-routing.module').then(m => m.AdminRoutingModule),
        },
        {
          path: 'account',
          loadChildren: () => import('./account/account.module').then(m => m.AccountModule),
        },
Michael Breu's avatar
Michael Breu committed
        {
          path: 'login',
          loadChildren: () => import('./login/login.module').then(m => m.LoginModule),
        },
  {
    path: 'search',
    loadChildren: () => import('app/search/search.module').then(m => m.SearchModule)
  },
  {
    path: 'bookmarks',
    loadChildren: () => import('app/bookmarks/bookmarks.module').then(m => m.BookmarskModule)
  },
  {
    path: 'datapolicy',
    component: DatapolicyComponent
  },
  {
    path: 'import',
    loadChildren: () => import('app/exercise/import/exercise-import.module').then(m => m.ExerciseImportModule)
  },
Michael Breu's avatar
Michael Breu committed
        {
          path: '',
          loadChildren: () => import(`./entities/entity-routing.module`).then(m => m.EntityRoutingModule),
        },
        navbarRoute,
        ...errorRoute,
      ],
      { enableTracing: DEBUG_INFO_ENABLED }
    ),
  ],
  exports: [RouterModule],
Lukas Kaltenbrunner's avatar
Lukas Kaltenbrunner committed
})
Michael Breu's avatar
Michael Breu committed
export class AppRoutingModule {}