I'm passing the whole pipe as one of the parameters and I have a hard time using it.
The object format is like the following:
{
column: 'productExpirationDate',
caption: 'Product expiration date',
pipe: 'date: \"' + PIPE_DATE_FORMAT + '\"'
},
While PIPE_DATE_FORMAT
holds 'yyyy-MM-dd'
the output format should be 'date: "yyyy-MM-dd"'
and if I try to use it in html file like
<span *ngIf="element.pipe">{{ row[element.column] | element.pipe }}</span>
it yells with
Parser Error: Unexpected token '.' ...
I've found Angular - pass pipe as variable post, but I can't figure out how do I make this work in my case. Moreover, get
method used in that answear is deprecated which only adds more confusion.
How am I able to use that pipe from variable?