import { CommonModule } from '@angular/common'; import { NgModule } from '@angular/core'; import { RouterModule, Routes } from '@angular/router'; import { AttendanceTypeResolver } from '../attendance/attendance-type-resolver.service'; import { AuthGuard } from '../auth/auth-guard.service'; import { EmployeeAttendanceResolver } from './employee-attendance-resolver.service'; import { EmployeeAttendanceComponent } from './employee-attendance.component'; const employeeEmployeeAttendanceRoutes: Routes = [ { path: '', component: EmployeeAttendanceComponent, canActivate: [AuthGuard], data: { permission: 'Attendance', }, resolve: { info: EmployeeAttendanceResolver, attendanceTypes: AttendanceTypeResolver, }, runGuardsAndResolvers: 'always', }, { path: ':id', component: EmployeeAttendanceComponent, canActivate: [AuthGuard], data: { permission: 'Attendance', }, resolve: { info: EmployeeAttendanceResolver, attendanceTypes: AttendanceTypeResolver, }, runGuardsAndResolvers: 'always', }, ]; @NgModule({ imports: [CommonModule, RouterModule.forChild(employeeEmployeeAttendanceRoutes)], exports: [RouterModule], providers: [EmployeeAttendanceResolver], }) export class EmployeeAttendanceRoutingModule {}