import { Injectable, inject } from '@angular/core'; import { ActivatedRouteSnapshot } from '@angular/router'; import { Observable } from 'rxjs'; import { SavingsService } from '../savings.service'; @Injectable({ providedIn: 'root' }) export class SavingNotesResolver { private savingsService = inject(SavingsService); /** * Returns the Savings data. * @returns {Observable} */ resolve(route: ActivatedRouteSnapshot): Observable { const savingAccountId = route.parent.paramMap.get('savingAccountId'); return this.savingsService.getSavingsNotes(savingAccountId); } }