Files
cbsnexora/src/app/savings/common-resolvers/savings-account-view.resolver.ts
T
Ralph HopmanandAdam Saghy cac1d11ad7 build: Use prettier for typescript
Stop ignoring .ts files in prettier and fix existing issues.
2025-01-15 11:59:30 +00:00

31 lines
869 B
TypeScript

/** Angular Imports */
import { Injectable } from '@angular/core';
import { Resolve, ActivatedRouteSnapshot } from '@angular/router';
/** rxjs Imports */
import { Observable } from 'rxjs';
/** Custom Services */
import { SavingsService } from '../savings.service';
/**
* Savings Account data resolver.
*/
@Injectable()
export class SavingsAccountViewResolver implements Resolve<Object> {
/**
* @param {SavingsService} SavingsService Savings service.
*/
constructor(private savingsService: SavingsService) {}
/**
* Returns the Savings Account data.
* @param {ActivatedRouteSnapshot} route Route Snapshot
* @returns {Observable<any>}
*/
resolve(route: ActivatedRouteSnapshot): Observable<any> {
const savingAccountId = route.paramMap.get('savingAccountId');
return this.savingsService.getSavingsAccountData(savingAccountId);
}
}