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

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

    
56
//export const appRoutingProviders: any[] = [];
57

    
58
//export const routing: ModuleWithProviders = RouterModule.forRoot(appRoutes);
59

    
60

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

    
66
export class AppRouting {}
67

    
(4-4/7)