30 lines
754 B
TypeScript
30 lines
754 B
TypeScript
/** Angular Imports */
|
|
import { Injectable } from '@angular/core';
|
|
import { ActivatedRouteSnapshot } from '@angular/router';
|
|
|
|
/** rxjs Imports */
|
|
import { Observable } from 'rxjs';
|
|
|
|
/** Custom Services */
|
|
import { ClientsService } from '../clients.service';
|
|
|
|
/**
|
|
* Client Documents resolver.
|
|
*/
|
|
@Injectable()
|
|
export class ClientDocumentsResolver {
|
|
/**
|
|
* @param {ClientsService} ClientsService Clients service.
|
|
*/
|
|
constructor(private clientsService: ClientsService) {}
|
|
|
|
/**
|
|
* Returns the Client's Documents data.
|
|
* @returns {Observable<any>}
|
|
*/
|
|
resolve(route: ActivatedRouteSnapshot): Observable<any> {
|
|
const clientId = route.parent.paramMap.get('clientId');
|
|
return this.clientsService.getClientDocuments(clientId);
|
|
}
|
|
}
|