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

Skip to content
Snippets Groups Projects
app-routing.module.ts 2.03 KiB
Newer Older
import { NgModule } from '@angular/core';
import { RouterModule } from '@angular/router';
import { errorRoute } from './layouts/error/error.route';
import { navbarRoute } from './layouts/navbar/navbar.route';
Michael Breu's avatar
Michael Breu committed
import { PagesResolve } from 'app/editorialPages/pages.route';
import { PagesComponent } from 'app/editorialPages/pages.component';

import { DEBUG_INFO_ENABLED } from 'app/app.constants';
import { Authority } from 'app/shared/constants/authority.constants';
import { UserRouteAccessService } from 'app/core/auth/user-route-access-service';
Michael Breu's avatar
Michael Breu committed
const LAYOUT_ROUTES = [navbarRoute, ...errorRoute];
Lukas Kaltenbrunner's avatar
Lukas Kaltenbrunner 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),
        },
Lukas Kaltenbrunner's avatar
Lukas Kaltenbrunner committed
        {
          path: 'search',
          loadChildren: () => import('app/search/search.module').then(m => m.SearchModule),
Lukas Kaltenbrunner's avatar
Lukas Kaltenbrunner committed
        },
        {
          path: 'bookmarks',
          loadChildren: () => import('app/bookmarks/bookmarks.module').then(m => m.BookmarskModule),
        },
        {
          path: 'import',
          loadChildren: () => import('app/exercise/import/exercise-import.module').then(m => m.ExerciseImportModule),
        },
Michael Breu's avatar
Michael Breu committed
        {
          path: 'pages',
          children: [
            {
              path: "**",
              loadChildren: () => import('app/editorialPages/editorialPages.module').then(m => m.PagesModule),
              resolve: {
                      pagePath: PagesResolve,
                    },
              component: PagesComponent,


            }
            ]
        },
Lukas Kaltenbrunner's avatar
Lukas Kaltenbrunner committed
        ...LAYOUT_ROUTES,
      ],
      { enableTracing: DEBUG_INFO_ENABLED }
Lukas Kaltenbrunner's avatar
Lukas Kaltenbrunner committed
    ),
  ],
  exports: [RouterModule],
})
export class GitSearchV2AppRoutingModule {}