本文整理汇总了TypeScript中@angular/core.PipeTransform类的典型用法代码示例。如果您正苦于以下问题:TypeScript PipeTransform类的具体用法?TypeScript PipeTransform怎么用?TypeScript PipeTransform使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
在下文中一共展示了PipeTransform类的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的TypeScript代码示例。
示例1: value
get value() {
if (!this.row) return '';
const prop: any = deepValueGetter(this.row, this.column.prop);
const userPipe: PipeTransform = this.column.pipe;
return userPipe ? userPipe.transform(prop) : prop;
}
示例2: getCellData
/**
* @param value data to render integer
*/
getCellData(value: any) {
let parsedValue: string;
if (typeof this.pipeArguments !== 'undefined' && value !== undefined) {
parsedValue = this.componentPipe.transform(value, this.pipeArguments);
}
return parsedValue;
}
示例3: getCellData
/**
* @param value data to render integer
*/
getCellData(cellvalue: any, rowvalue?: any) {
let parsedValue: string;
if (this.componentPipe && typeof this.pipeArguments !== 'undefined' && cellvalue !== undefined) {
parsedValue = this.componentPipe.transform(cellvalue, this.pipeArguments);
} else {
parsedValue = cellvalue;
}
return parsedValue;
}
示例4: it
it('should transform html to the SafeHtml', () => {
const html = '<a href="#">foo</a>';
const sanitized = '<a href="#">sanitized</a>';
sanitizerSpy.bypassSecurityTrustHtml.and.returnValue(sanitized);
const safeHtml: SafeHtml = safeHtmlPipe.transform(html);
expect(safeHtml).toEqual(sanitized);
expect(sanitizerSpy.bypassSecurityTrustHtml).toHaveBeenCalledTimes(1);
expect(sanitizerSpy.bypassSecurityTrustHtml).toHaveBeenCalledWith(html);
});
示例5:
return () => (value: any, ...args: any[]): any => {
return pipe.transform(value, ...args);
};