1 |
f8b9a3a2
|
hlavja
|
import {NgModule} from '@angular/core';
|
2 |
|
|
import {RouterModule, Routes} from '@angular/router';
|
3 |
675bbb8c
|
hlavja
|
import {LoginComponent} from './login/components/login.component';
|
4 |
|
|
import {DashboardComponent} from './dashboard/components/dashboard.component';
|
5 |
2c5da396
|
hlavja
|
import {AuthGuard} from './auth/guards/auth.guard';
|
6 |
|
|
import {RoleGuard} from './auth/guards/role.guard';
|
7 |
|
|
import {AdministrationComponent} from './administration/components/administration.component';
|
8 |
ee1670e3
|
hlavja
|
|
9 |
f8b9a3a2
|
hlavja
|
const routes: Routes = [
|
10 |
|
|
{
|
11 |
|
|
path: '',
|
12 |
675bbb8c
|
hlavja
|
redirectTo: 'login',
|
13 |
|
|
pathMatch: 'full'
|
14 |
|
|
}, {
|
15 |
2c5da396
|
hlavja
|
canActivate: [AuthGuard],
|
16 |
675bbb8c
|
hlavja
|
path: 'dashboard',
|
17 |
|
|
component: DashboardComponent,
|
18 |
2c5da396
|
hlavja
|
pathMatch: 'full'
|
19 |
|
|
},
|
20 |
|
|
{
|
21 |
|
|
canActivate: [AuthGuard, RoleGuard],
|
22 |
|
|
path: 'administration',
|
23 |
|
|
component: AdministrationComponent,
|
24 |
675bbb8c
|
hlavja
|
pathMatch: 'full',
|
25 |
|
|
data: {
|
26 |
2c5da396
|
hlavja
|
expectedRole: ['1']
|
27 |
675bbb8c
|
hlavja
|
}
|
28 |
|
|
},{
|
29 |
|
|
path: 'login',
|
30 |
|
|
component: LoginComponent,
|
31 |
f8b9a3a2
|
hlavja
|
pathMatch: 'full',
|
32 |
|
|
}
|
33 |
|
|
];
|
34 |
ee1670e3
|
hlavja
|
|
35 |
|
|
@NgModule({
|
36 |
|
|
imports: [RouterModule.forRoot(routes)],
|
37 |
|
|
exports: [RouterModule]
|
38 |
|
|
})
|
39 |
f8b9a3a2
|
hlavja
|
export class AppRoutingModule {
|
40 |
|
|
}
|