projects/i-components/src/lib/pipes/replaceColumnField.pipe.ts
Pipe to access and replace ColumnField string
Name | replaceColumnField |
Pure | true |
transform | ||||||
transform(cell: IgxGridCell)
|
||||||
Transform cell into a valid string.
Parameters :
Returns :
string
{string} |
import { Pipe, PipeTransform } from '@angular/core';
import { IgxGridCell } from 'igniteui-angular';
/**
* Pipe to access and replace ColumnField string
*/
@Pipe({
name: 'replaceColumnField',
pure: true,
})
export class ReplaceColumnField implements PipeTransform {
/**
* Transform cell into a valid string.
*
* @param {IgxGridCell} cell
* @return {*} {string}
* @memberof ReplaceColumnField
*/
transform(cell: IgxGridCell): string {
return cell.row.data.data[cell.column.field.replace('data.', '')];
}
}