import { Pipe , PipeTransform } from '@angular/core' ; import { Observable } from 'rxjs' ; import { Currency } from './currency' ; import { CurrencyService } from './currency.service' ; @ Pipe ( { name : 'currency' } ) export class CurrencyPipe implements PipeTransform { constructor ( private readonly currencyService ) { } public transform ( currency ) { return this . currencyService . searchById ( currency ) ; } }