feat(challenge16): di

This commit is contained in:
thomas
2023-03-06 15:33:47 +01:00
parent 4f529c9427
commit 011ca2f462
19 changed files with 1529 additions and 458 deletions

View File

@@ -0,0 +1,17 @@
import { inject, Pipe, PipeTransform } from '@angular/core';
import { map } from 'rxjs';
import { CurrencyService } from './currency.service';
@Pipe({
name: 'currency',
standalone: true,
})
export class CurrencyPipe implements PipeTransform {
currencyService = inject(CurrencyService);
transform(price: number) {
return this.currencyService.symbol$.pipe(
map((s) => `${String(price)}${s}`)
);
}
}