feat: add view employee component (#546)

Fixes: #534
This commit is contained in:
Rishabh Verma
2020-01-05 19:10:47 +03:00
committed by Abhay Chawla
parent 4ac086381f
commit df12a6b4ba
9 changed files with 198 additions and 2 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 'app/organization/organization.service';
/**
* Employee data resolver.
*/
@Injectable()
export class EmployeeResolver implements Resolve<Object> {
/**
* @param {OrganizationService} organizationService Organization service.
*/
constructor(private organizationService: OrganizationService) {}
/**
* Returns the employee data.
* @returns {Observable<any>}
*/
resolve(route: ActivatedRouteSnapshot): Observable<any> {
const employeeId = route.paramMap.get('id');
return this.organizationService.getEmployee(employeeId);
}
}