Project

General

Profile

1

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

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

    
61
//export const appRoutingProviders: any[] = [];
62

    
63
//export const routing: ModuleWithProviders = RouterModule.forRoot(appRoutes);
64

    
65

    
66
@NgModule ({
67
  imports: [RouterModule.forRoot(appRoutes)],
68
  exports: [RouterModule]
69
})
70

    
71
export class AppRouting {}
72

    
(4-4/7)