You can extend CurrencyPipe
, something like this:
export class FormatCurrency extends CurrencyPipe implements PipeTransform {
transform(value: any, args: any[]): string {
let formatedByCurrencyPipe = super.transform(value, args);
let formatedByMe;
// do your thing...
return formatedByMe;
}
}
If you look at the source, that's similar to how angular pipes work...
(Added by question author)
Don't forget to import the CurrencyPipe Class
import {CurrencyPipe} from 'angular2/common';
与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…