I have a table in which I'm showing some data for each selected row like this
<table>
<th>Col-1</th>
<th>Col-2</th>
<th></th>
<tr *ngFor="let obj of data; let i=index">
<td>{{obj.id}}</td>
<td>{{obj.name}}</td>
<button (click)="myFunction(i)">Click</button>
<br>
<div>Some dynamic data</div>
</tr>
</table>
I want to display the div tag content for only clicked row and if I click other row button, that row with div should get displayed and previous div should be hidden. How do I achieve this? Please suggest
showRowboolean property to each row to toggle between them