brewman/overlord/src/app/receipt/receipt-accounts-resolver.service.ts

17 lines
589 B
TypeScript
Raw Normal View History

import { Injectable } from '@angular/core';
import { ActivatedRouteSnapshot, Resolve, RouterStateSnapshot } from '@angular/router';
import { Observable } from 'rxjs/internal/Observable';
import { Account } from '../core/account';
import { AccountService } from '../core/account.service';
@Injectable({
providedIn: 'root',
})
export class ReceiptAccountsResolver implements Resolve<Account[]> {
constructor(private ser: AccountService) {}
resolve(route: ActivatedRouteSnapshot, state: RouterStateSnapshot): Observable<Account[]> {
return this.ser.receiptAutocomplete('');
}
}