/**
   * @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;
  }
  /**
   * @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;
  }
Example #3
0
  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);
  });
Example #4
0
 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;
 }
	return () => (value: any, ...args: any[]): any => {
		return pipe.transform(value, ...args);
	};