Project

General

Profile

1
import { NgModule } from '@angular/core';
2
import { Routes, RouterModule } from '@angular/router';
3
import { HomeComponent } from './pages/home/home.component';
4
import { CountriesMapOverviewComponent } from './pages/home/countries-map-overview.component';
5
import { CountryPageComponent } from './pages/countrypage/country-page.component';
6
import { MethodologyPageComponent } from './pages/methodology/methodology.component';
7
import { ContinentOverviewComponent } from './pages/continentoverview/continent-overview.component';
8

    
9
const routes: Routes = [
10
  {
11
    path: '',
12
    redirectTo: '/home',
13
    pathMatch: 'full'
14
  },
15
  {
16
    path: 'home',
17
    component: HomeComponent
18
  },
19
  {
20
    path: 'overview-map-embed',
21
    component: CountriesMapOverviewComponent
22
  },
23
  {
24
    path: 'overview/:continentName',
25
    component: ContinentOverviewComponent
26
  },
27
  {
28
    path: 'countryDashboard/:countryCode',
29
    component: CountryPageComponent
30
  },
31
  {
32
    path: 'methodology',
33
    component: MethodologyPageComponent
34
  },
35
];
36

    
37
@NgModule({
38
  imports: [RouterModule.forRoot(routes, {
39
    // preloadingStrategy: PreloadAllModules,
40
    // scrollPositionRestoration: 'top',
41
    onSameUrlNavigation: 'reload',
42
    // relativeLinkResolution: 'corrected'
43
  })],
44
  exports: [RouterModule]
45
})
46
export class AppRoutingModule { }
(1-1/7)