52 lines
1.4 KiB
TypeScript
52 lines
1.4 KiB
TypeScript
import {NgModule} from '@angular/core';
|
|
import {Routes, RouterModule, PreloadAllModules} from '@angular/router';
|
|
import {PreviousRouteRecorder} from './openaireLibrary/utils/piwik/previousRouteRecorder.guard';
|
|
import {ErrorPageComponent} from './openaireLibrary/error/errorPage.component';
|
|
|
|
const appRoutes: Routes = [
|
|
{
|
|
path: '',
|
|
loadChildren: './home/home.module#HomeModule',
|
|
data: {
|
|
isHome: true
|
|
},
|
|
canDeactivate: [PreviousRouteRecorder]
|
|
},
|
|
{
|
|
path: 'resources',
|
|
loadChildren: './resources/resources.module#ResourcesModule',
|
|
canDeactivate: [PreviousRouteRecorder]
|
|
},
|
|
{
|
|
path: 'analytics',
|
|
loadChildren: './analytics/analytics.module#AnalyticsModule',
|
|
canDeactivate: [PreviousRouteRecorder]
|
|
},
|
|
{
|
|
path: 'contact',
|
|
loadChildren: './contact/contact.module#ContactModule',
|
|
canDeactivate: [PreviousRouteRecorder]
|
|
},
|
|
{
|
|
path: 'about',
|
|
loadChildren: './about/about.module#AboutModule',
|
|
canDeactivate: [PreviousRouteRecorder]
|
|
},
|
|
{
|
|
path: 'sushilite/:id',
|
|
loadChildren: './sushilite/sushilite.module#SushiliteModule',
|
|
canDeactivate: [PreviousRouteRecorder]
|
|
},
|
|
{ path: '**',pathMatch: 'full',component: ErrorPageComponent}
|
|
];
|
|
|
|
@NgModule({
|
|
imports: [RouterModule.forRoot(appRoutes, {
|
|
preloadingStrategy: PreloadAllModules,
|
|
scrollPositionRestoration: 'top'
|
|
})],
|
|
exports: [RouterModule]
|
|
})
|
|
export class AppRoutingModule {
|
|
}
|