/** Angular Imports */ import { Injectable } from '@angular/core'; import { 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 { /** * @param {OrganizationService} organizationService Organization service. */ constructor(private organizationService: OrganizationService) {} /** * Returns the employee data. * @returns {Observable} */ resolve(route: ActivatedRouteSnapshot): Observable { const employeeId = route.paramMap.get('id'); return this.organizationService.getEmployee(employeeId); } }