53 lines
1.2 KiB
TypeScript
53 lines
1.2 KiB
TypeScript
|
import {NgModule} from '@angular/core';
|
||
|
import {CommonModule} from '@angular/common';
|
||
|
import {RouterModule, Routes} from '@angular/router';
|
||
|
import {AttendanceResolver} from './attendance-resolver.service';
|
||
|
import {AuthGuard} from '../auth/auth-guard.service';
|
||
|
import {AttendanceComponent} from './attendance.component';
|
||
|
import {AttendanceTypeResolver} from './attendance-type-resolver.service';
|
||
|
|
||
|
const attendanceRoutes: Routes = [
|
||
|
{
|
||
|
path: 'Attendance',
|
||
|
component: AttendanceComponent,
|
||
|
canActivate: [AuthGuard],
|
||
|
data: {
|
||
|
permission: 'Attendance'
|
||
|
},
|
||
|
resolve: {
|
||
|
info: AttendanceResolver,
|
||
|
attendanceTypes: AttendanceTypeResolver
|
||
|
},
|
||
|
runGuardsAndResolvers: 'always'
|
||
|
},
|
||
|
{
|
||
|
path: 'Attendance/:date',
|
||
|
component: AttendanceComponent,
|
||
|
canActivate: [AuthGuard],
|
||
|
data: {
|
||
|
permission: 'Attendance'
|
||
|
},
|
||
|
resolve: {
|
||
|
info: AttendanceResolver,
|
||
|
attendanceTypes: AttendanceTypeResolver
|
||
|
},
|
||
|
runGuardsAndResolvers: 'always'
|
||
|
}
|
||
|
];
|
||
|
|
||
|
@NgModule({
|
||
|
imports: [
|
||
|
CommonModule,
|
||
|
RouterModule.forChild(attendanceRoutes)
|
||
|
|
||
|
],
|
||
|
exports: [
|
||
|
RouterModule
|
||
|
],
|
||
|
providers: [
|
||
|
AttendanceResolver
|
||
|
]
|
||
|
})
|
||
|
export class AttendanceRoutingModule {
|
||
|
}
|