Projekt

Obecné

Profil

Stáhnout (1018 Bajtů) 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 37412123 Václav Jirák
9 0d1b0550 Václav Jirák
const routes: Routes = [
10 c335ea37 Hung Hoang
  { path: 'employees', component: EmployeesListComponent, canActivate: [EmployeeComponentGuard], runGuardsAndResolvers: 'always'},
11
  { path: 'dashboard', component: DashboardComponent, canActivate: [DashboardComponentGuard], runGuardsAndResolvers: 'always'},
12 0d1b0550 Václav Jirák
  { path: '', redirectTo: '/dashboard', pathMatch: 'full' },
13 4bd9d9f6 Hung Hoang
  { path: '**', component: PageNotFoundComponent }
14 0d1b0550 Václav Jirák
];
15 37412123 Václav Jirák
16
@NgModule({
17 c335ea37 Hung Hoang
  imports: [RouterModule.forRoot(routes, {onSameUrlNavigation: 'reload'})],
18 37412123 Václav Jirák
  exports: [RouterModule]
19
})
20
export class AppRoutingModule { }