I am looking to implement a toggle button in my table that will allow users to show/hide additional details for a selected row.
This is an example of the table structure I am working with:
<table>
<tr>
<th>Company</th>
<th>Contact</th>
<th>Country</th>
</tr>
<tr *ngFor='let c of companies'>
<td><button id="{{c.companyId}}" (click)="showDetail()">Details</button> </td>
<td>{{ c.company}}</td>
<td>{{ c.contact}}</td>
<td>{{ c.country }}</td>
</tr>
</table>
My goal is to have the details displayed inline within the table when the user clicks on the "Details" button. I am exploring options to achieve this functionality efficiently using Angular2 and typescript. Any suggestions for a better approach to display details in a user-friendly way?