1
|
import {NgModule} from '@angular/core';
|
2
|
import {Routes, RouterModule, PreloadAllModules} from '@angular/router';
|
3
|
import {ErrorPageComponent} from './openaireLibrary/error/errorPage.component';
|
4
|
import {PreviousRouteRecorder} from './openaireLibrary/utils/piwik/previousRouteRecorder.guard';
|
5
|
|
6
|
const appRoutes: Routes = [
|
7
|
{
|
8
|
path: '',
|
9
|
loadChildren: './home/home.module#HomeModule',
|
10
|
data: {
|
11
|
isHome: true
|
12
|
}, canDeactivate: [PreviousRouteRecorder]
|
13
|
},
|
14
|
{
|
15
|
path: 'resources',
|
16
|
loadChildren: './resources/resources.module#ResourcesModule',
|
17
|
canDeactivate: [PreviousRouteRecorder]
|
18
|
},
|
19
|
{
|
20
|
path: 'support',
|
21
|
loadChildren: './contact/contact.module#ContactModule',
|
22
|
canDeactivate: [PreviousRouteRecorder]
|
23
|
},
|
24
|
{
|
25
|
path: 'about',
|
26
|
loadChildren: './about/about.module#AboutModule',
|
27
|
canDeactivate: [PreviousRouteRecorder]
|
28
|
},
|
29
|
{ path: '**',pathMatch: 'full',component: ErrorPageComponent}
|
30
|
];
|
31
|
|
32
|
@NgModule({
|
33
|
imports: [RouterModule.forRoot(appRoutes, {
|
34
|
preloadingStrategy: PreloadAllModules,
|
35
|
scrollPositionRestoration: 'top'
|
36
|
})],
|
37
|
exports: [RouterModule]
|
38
|
})
|
39
|
export class AppRoutingModule {
|
40
|
}
|