When I receive data from the server, it includes an object with columns and rows. I want to loop through the columns and rows to create an HTML table, formatting the cells based on the column type using a "format" pipe.
For example:
Server Response:
{
"columns" [{"precision":10,"name":"PAGES","typeName":"INTEGER","scale":0...,
"rows":[{"PAGES":6531....}, [{"PAGES":6531....}]
}
HTML snippet:
<tr *ngFor="let row of invoices?.rows">
<td *ngFor="let column of invoices?.columns>
{{row[column.name] | format : column}}
</td>
</tr>
Is there a way for my "format" pipe to delegate to the appropriate built-in pipe (if available) based on the column type? I'd prefer not to have to reimplement DecimalPipe, DatePipe, etc.