本文整理汇总了TypeScript中@angular/core.PipeTransform.transform方法的典型用法代码示例。如果您正苦于以下问题:TypeScript PipeTransform.transform方法的具体用法?TypeScript PipeTransform.transform怎么用?TypeScript PipeTransform.transform使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类@angular/core.PipeTransform
的用法示例。
在下文中一共展示了PipeTransform.transform方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的TypeScript代码示例。
示例1: 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;
}
示例2: 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;
}
示例3: 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);
});
示例4: 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;
}
示例5: return
return () => (value: any, ...args: any[]): any => {
return pipe.transform(value, ...args);
};