【发布时间】:2016-06-18 21:49:55
【问题描述】:
我想为基本的 angular2 管道添加一些额外的功能。
即。在货币管道上完成了一些额外的格式化。为此,我想在自定义管道的组件代码中使用现有管道。
有什么办法可以做到吗?
@Pipe({name: 'formatCurrency'})
export class FormatCurrency implements PipeTransform {
transform(value:number, args:string[]) : any {
var formatted = value/100;
//I would like to use the basic currecy pipe here.
///100 | currency:'EUR':true:'.2'
return 'Do some extra things here ' + formatted;
}
}
【问题讨论】:
标签: angular angular-pipe