Projekt

Obecné

Profil

Stáhnout (754 Bajtů) 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

    
6
const routes: Routes = [
7
  {
8
    // canActivate: [AuthGuard],
9
    path: '',
10
    redirectTo: 'login',
11
    pathMatch: 'full'
12
  }, {
13
    // canActivate: [AuthGuard, RoleGuard],
14
    path: 'dashboard',
15
    component: DashboardComponent,
16
    pathMatch: 'full',
17
    data: {
18
      expectedRole: ['ROLE_ADMIN']
19
    }
20
  },{
21
    path: 'login',
22
    component: LoginComponent,
23
    pathMatch: 'full',
24
  }
25
];
26

    
27
@NgModule({
28
  imports: [RouterModule.forRoot(routes)],
29
  exports: [RouterModule]
30
})
31
export class AppRoutingModule {
32
}
(1-1/3)