Revision 61399
Added by Konstantinos Triantafyllou almost 3 years ago
app.routing.ts | ||
---|---|---|
1 | 1 |
import {NgModule} from '@angular/core'; |
2 |
import {Routes, RouterModule, PreloadAllModules} from '@angular/router';
|
|
2 |
import {RouterModule, Routes} from '@angular/router';
|
|
3 | 3 |
import {PreviousRouteRecorder} from './openaireLibrary/utils/piwik/previousRouteRecorder.guard'; |
4 | 4 |
import {ErrorPageComponent} from './openaireLibrary/error/errorPage.component'; |
5 | 5 |
|
6 | 6 |
const appRoutes: Routes = [ |
7 | 7 |
{ |
8 | 8 |
path: '', |
9 |
loadChildren: './home/home.module#HomeModule',
|
|
9 |
loadChildren: () => import('./home/home.module').then(m => m.HomeModule),
|
|
10 | 10 |
data: { |
11 | 11 |
isHome: true |
12 | 12 |
}, |
... | ... | |
14 | 14 |
}, |
15 | 15 |
{ |
16 | 16 |
path: 'resources', |
17 |
loadChildren: './resources/resources.module#ResourcesModule',
|
|
17 |
loadChildren: () => import('./resources/resources.module').then(m => m.ResourcesModule),
|
|
18 | 18 |
canDeactivate: [PreviousRouteRecorder] |
19 | 19 |
}, |
20 | 20 |
{ |
21 | 21 |
path: 'analytics', |
22 |
loadChildren: './analytics/analytics.module#AnalyticsModule',
|
|
22 |
loadChildren: () => import('./analytics/analytics.module').then(m => m.AnalyticsModule),
|
|
23 | 23 |
canDeactivate: [PreviousRouteRecorder] |
24 | 24 |
}, |
25 | 25 |
{ |
26 | 26 |
path: 'contact', |
27 |
loadChildren: './contact/contact.module#ContactModule',
|
|
27 |
loadChildren: () => import('./contact/contact.module').then(m => m.ContactModule),
|
|
28 | 28 |
canDeactivate: [PreviousRouteRecorder] |
29 | 29 |
}, |
30 | 30 |
{ |
31 | 31 |
path: 'about', |
32 |
loadChildren: './about/about.module#AboutModule',
|
|
32 |
loadChildren: () => import('./about/about.module').then(m => m.AboutModule),
|
|
33 | 33 |
canDeactivate: [PreviousRouteRecorder] |
34 | 34 |
}, |
35 | 35 |
{ |
36 | 36 |
path: 'sushilite/:id', |
37 |
loadChildren: './sushilite/sushilite.module#SushiliteModule',
|
|
37 |
loadChildren: () => import('./sushilite/sushilite.module').then(m => m.SushiliteModule),
|
|
38 | 38 |
canDeactivate: [PreviousRouteRecorder] |
39 | 39 |
}, |
40 | 40 |
{ path: '**',pathMatch: 'full',component: ErrorPageComponent} |
... | ... | |
42 | 42 |
|
43 | 43 |
@NgModule({ |
44 | 44 |
imports: [RouterModule.forRoot(appRoutes, { |
45 |
preloadingStrategy: PreloadAllModules, |
|
46 |
onSameUrlNavigation: "reload", |
|
47 |
relativeLinkResolution: 'corrected' |
|
45 |
onSameUrlNavigation: "reload" |
|
48 | 46 |
})], |
49 | 47 |
exports: [RouterModule] |
50 | 48 |
}) |
Also available in: Unified diff
[Usage Counts | Trunk]: Update to angular 11