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

Skip to content
Snippets Groups Projects
app-routing.module.ts 2.09 KiB
Newer Older
import { NgModule } from '@angular/core';
import { RouterModule } from '@angular/router';
import { pagesRoutes } from 'app/editorialPages/pages.route';
Michael Breu's avatar
Michael Breu committed
import { exerciseRoutes } from 'app/exercisePage/exercise.route';
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';
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),
        },
Michael Breu's avatar
Michael Breu committed
        exerciseRoutes,
        {
          path: 'bookmarks',
Michael Breu's avatar
Michael Breu committed
          loadChildren: () => import('app/bookmarks/bookmarks.module').then(m => m.BookmarksModule),
        },
        {
          path: 'datapolicy',
          component: DatapolicyComponent,
        },
        {
          path: 'import',
          loadChildren: () => import('app/exercise/import/exercise-import.module').then(m => m.ExerciseImportModule),
        },
        pagesRoutes,
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 {}