Newer
Older
import { NgModule } from '@angular/core';
import { RouterModule } from '@angular/router';
import { pagesRoutes } from 'app/editorialPages/pages.route';
import { exerciseRoutes } from 'app/exercisePage/exercise.route';
import { errorRoute } from './layouts/error/error.route';
import { navbarRoute } from './layouts/navbar/navbar.route';
import { DEBUG_INFO_ENABLED } from 'app/app.constants';
import { Authority } from 'app/config/authority.constants';
import { DatapolicyComponent } from './layouts/datapolicy/datapolicy.component';
import { UserRouteAccessService } from 'app/core/auth/user-route-access.service';
@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),
},
{
path: 'login',
loadChildren: () => import('./login/login.module').then(m => m.LoginModule),
},
{
path: 'search',
loadChildren: () => import('app/search/search.module').then(m => m.SearchModule),
},
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,
{
path: '',
loadChildren: () => import(`./entities/entity-routing.module`).then(m => m.EntityRoutingModule),
},
navbarRoute,
...errorRoute,
],
{ enableTracing: DEBUG_INFO_ENABLED }
),
],
exports: [RouterModule],