67 lines
1.5 KiB
TypeScript
67 lines
1.5 KiB
TypeScript
|
import {NgModule} from '@angular/core';
|
||
|
import {CommonModule} from '@angular/common';
|
||
|
import {RouterModule, Routes} from '@angular/router';
|
||
|
|
||
|
import {EmployeeListResolver} from './employee-list-resolver.service';
|
||
|
import {EmployeeResolver} from './employee-resolver.service';
|
||
|
import {EmployeeDetailComponent} from './employee-detail/employee-detail.component';
|
||
|
import {EmployeeListComponent} from './employee-list/employee-list.component';
|
||
|
|
||
|
import {AuthGuard} from '../auth/auth-guard.service';
|
||
|
import {CostCentreListResolver} from '../cost-centre/cost-centre-list-resolver.service';
|
||
|
|
||
|
const employeeRoutes: Routes = [
|
||
|
{
|
||
|
path: 'Employees',
|
||
|
component: EmployeeListComponent,
|
||
|
canActivate: [AuthGuard],
|
||
|
data: {
|
||
|
permission: 'Employees'
|
||
|
},
|
||
|
resolve: {
|
||
|
list: EmployeeListResolver
|
||
|
}
|
||
|
},
|
||
|
{
|
||
|
path: 'Employee',
|
||
|
component: EmployeeDetailComponent,
|
||
|
canActivate: [AuthGuard],
|
||
|
data: {
|
||
|
permission: 'Employees'
|
||
|
},
|
||
|
resolve: {
|
||
|
item: EmployeeResolver,
|
||
|
costCentres: CostCentreListResolver
|
||
|
}
|
||
|
},
|
||
|
{
|
||
|
path: 'Employee/:id',
|
||
|
component: EmployeeDetailComponent,
|
||
|
canActivate: [AuthGuard],
|
||
|
data: {
|
||
|
permission: 'Employees'
|
||
|
},
|
||
|
resolve: {
|
||
|
item: EmployeeResolver,
|
||
|
costCentres: CostCentreListResolver
|
||
|
}
|
||
|
}
|
||
|
];
|
||
|
|
||
|
@NgModule({
|
||
|
imports: [
|
||
|
CommonModule,
|
||
|
RouterModule.forChild(employeeRoutes)
|
||
|
|
||
|
],
|
||
|
exports: [
|
||
|
RouterModule
|
||
|
],
|
||
|
providers: [
|
||
|
EmployeeListResolver,
|
||
|
EmployeeResolver
|
||
|
]
|
||
|
})
|
||
|
export class EmployeeRoutingModule {
|
||
|
}
|