Projekt

Obecné

Profil

Stáhnout (1.09 KB) Statistiky
| Větev: | Tag: | Revize:
1 1c220966 Hung Hoang
import {NgModule} from '@angular/core';
2
import {RouterModule, Routes} from '@angular/router';
3 7c56b223 Hung Hoang
import {EmployeesListComponent} from './employees/employees-list.component';
4 0d1b0550 Václav Jirák
import {DashboardComponent} from './dashboard/dashboard.component';
5 4bd9d9f6 Hung Hoang
import {PageNotFoundComponent} from './page-not-found/page-not-found.component';
6 1c220966 Hung Hoang
import {EmployeeComponentGuard} from './auth/employee-component.guard';
7
import {DashboardComponentGuard} from './auth/dashboard-component.guard';
8 76eb842a Jakub Danek
import {LoginComponent} from "./login/login.component";
9 37412123 Václav Jirák
10 0d1b0550 Václav Jirák
const routes: Routes = [
11 c335ea37 Hung Hoang
  { path: 'employees', component: EmployeesListComponent, canActivate: [EmployeeComponentGuard], runGuardsAndResolvers: 'always'},
12
  { path: 'dashboard', component: DashboardComponent, canActivate: [DashboardComponentGuard], runGuardsAndResolvers: 'always'},
13 76eb842a Jakub Danek
  {path: 'login', component: LoginComponent},
14 0d1b0550 Václav Jirák
  { path: '', redirectTo: '/dashboard', pathMatch: 'full' },
15 4bd9d9f6 Hung Hoang
  { path: '**', component: PageNotFoundComponent }
16 0d1b0550 Václav Jirák
];
17 37412123 Václav Jirák
18
@NgModule({
19 c335ea37 Hung Hoang
  imports: [RouterModule.forRoot(routes, {onSameUrlNavigation: 'reload'})],
20 37412123 Václav Jirák
  exports: [RouterModule]
21
})
22
export class AppRoutingModule { }