Project

General

Profile

1
import { RouterModule, Routes } from '@angular/router';
2
import { NgModule } from '@angular/core';
3
import { LandingComponent } from './pages/landing/landing.component';
4
import { AuthGuardService } from './services/auth-guard.service';
5
import { DashboardComponent } from './pages/dashboard/dashboard.component';
6
import { ForbiddenPageComponent } from './shared/reusablecomponents/403-forbidden-page.component';
7

    
8
const appRoutes: Routes = [
9
  {
10
    path: '',
11
    redirectTo: '/landing',
12
    pathMatch: 'full'
13
  },
14
  {
15
    path: 'landing',
16
    component: LandingComponent
17
  },
18
  {
19
    path: 'dashboard',
20
    component: DashboardComponent,
21
    canActivate: [AuthGuardService]
22
  },
23
  {
24
    path: 'sources',
25
    loadChildren: './pages/sources/sources.module#SourcesModule',
26
    canActivate: [AuthGuardService]
27
  },
28
  {
29
    path: 'compatibility',
30
    loadChildren: './pages/compatibility/compatibility.module#CompatibilityModule'
31
  },
32
  {
33
    path: 'content',
34
    loadChildren: './pages/content/content.module#ContentModule',
35
    canActivate: [AuthGuardService]
36
  },
37
  {
38
    path: 'getImpact',
39
    loadChildren: './pages/metrics/metrics.module#MetricsModule',
40
    canActivate: [AuthGuardService]
41
  },
42
  {
43
    path: 'admin',
44
    loadChildren: './pages/adminPg/adminPg.module#AdminPgModule',
45
    canActivate: [AuthGuardService],
46
    canLoad: [AuthGuardService]
47
  },
48
  {
49
    path: '403-forbidden',
50
    component: ForbiddenPageComponent
51
  },
52
  {
53
    path: '**',
54
    redirectTo: '/landing'
55
  }
56
];
57

    
58

    
59
@NgModule ({
60
  imports: [RouterModule.forRoot(appRoutes)],
61
  exports: [RouterModule]
62
})
63

    
64
export class AppRoutingModule {}
65

    
(1-1/6)