I get back from the server an object containing an array of columns with their definitions and an array of rows. I would like to iterate over the columns and rows as I build my HTML table and format the cells according to the column type returned using a "format" pipe.
For example
WS Response:
{
"columns" [{"precision":10,"name":"PAGES","typeName":"INTEGER","scale":0...,
"rows":[{"PAGES":6531....}, [{"PAGES":6531....}]
}
HTML fragment:
<tr *ngFor="let row of invoices?.rows">
<td *ngFor="let column of invoices?.columns>
{{row[column.name] | format : column}}
</td>
</tr>
Is there any way my "format" pipe can just act a a delegator to the correct built-in pipe (where one exits), depending on the type of the column? I don't want to have to re-implement DecimalPipe, DatePipe, etc. etc.