Projekt

Obecné

Profil

Stáhnout (1.01 KB) Statistiky
| Větev: | Tag: | Revize:
1
import {NgModule} from '@angular/core';
2
import {RouterModule, Routes} from '@angular/router';
3
import {LoginComponent} from './login/components/login.component';
4
import {DashboardComponent} from './dashboard/components/dashboard.component';
5
import {AuthGuard} from './auth/guards/auth.guard';
6
import {RoleGuard} from './auth/guards/role.guard';
7
import {AdministrationComponent} from './administration/components/administration.component';
8

    
9
const routes: Routes = [
10
  {
11
    path: '',
12
    redirectTo: 'login',
13
    pathMatch: 'full'
14
  }, {
15
    canActivate: [AuthGuard],
16
    path: 'dashboard',
17
    component: DashboardComponent,
18
    pathMatch: 'full'
19
  },
20
  {
21
    canActivate: [AuthGuard, RoleGuard],
22
    path: 'administration',
23
    component: AdministrationComponent,
24
    pathMatch: 'full',
25
    data: {
26
      expectedRole: ['1']
27
    }
28
  },{
29
    path: 'login',
30
    component: LoginComponent,
31
    pathMatch: 'full',
32
  }
33
];
34

    
35
@NgModule({
36
  imports: [RouterModule.forRoot(routes)],
37
  exports: [RouterModule]
38
})
39
export class AppRoutingModule {
40
}
(1-1/4)