feat: add edit employee component (#604)

Fixes: #581
This commit is contained in:
Ashutosh Sharma
2020-05-13 08:17:32 +05:30
committed by GitHub
parent 389eb5edd2
commit 17cab17d0b
9 changed files with 268 additions and 9 deletions
@@ -0,0 +1,31 @@
/** Angular Imports */
import { Injectable } from '@angular/core';
import { Resolve, ActivatedRouteSnapshot } from '@angular/router';
/** rxjs Imports */
import { Observable } from 'rxjs';
/** Custom Services */
import { OrganizationService } from '../organization.service';
/**
* Employees data resolver.
*/
@Injectable()
export class EditEmployeeResolver implements Resolve<Object> {
/**
* @param {OrganizationService} organizationService Organization service.
*/
constructor(private organizationService: OrganizationService) {}
/**
* Returns the employees data.
* @returns {Observable<any>}
*/
resolve(route: ActivatedRouteSnapshot): Observable<any> {
const employeeId = route.paramMap.get('id');
return this.organizationService.getEmployee(employeeId);
}
}