30 lines
760 B
TypeScript
30 lines
760 B
TypeScript
/** 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';
|
|
|
|
/**
|
|
* Teller data resolver.
|
|
*/
|
|
@Injectable()
|
|
export class TellerResolver {
|
|
/**
|
|
* @param {OrganizationService} organizationService Organization service.
|
|
*/
|
|
constructor(private organizationService: OrganizationService) {}
|
|
|
|
/**
|
|
* Returns the teller data.
|
|
* @returns {Observable<any>}
|
|
*/
|
|
resolve(route: ActivatedRouteSnapshot): Observable<any> {
|
|
const tellerId = route.paramMap.get('id');
|
|
return this.organizationService.getTeller(tellerId);
|
|
}
|
|
}
|