I am working with a table, where i require to apply the data visibility only available with header contains throw dynamic. how to achieve this?
here is my example:
columns = ['name', 'age']; //required fields declared. on change I need to update the data as well
html:
<table>
<tr>
<th *ngFor="let col of columns">{{col}}</th>
</tr>
<tr *ngFor="let item of data">
<td >{{item.name}}</td> //how to apply from header instead of manual
<td >{{item.age}}</td> //how to apply from header instead of manual
</tr>
</table>
expecting like :
<tr *ngFor="let col of columns">
<td >{{data('col')}</td> //name value
<td >{{data('col')}</td> //age value
</tr>
</table>