I'm currently grappling with how to retrieve the value of the nth cell in the same row as the button that was clicked in angular2. I understand that I need to pass the $event value, but I'm unsure of how to extract the relevant data.
In app.component.html
<table>
<thead>
<tr>
<th>Name</th>
<th>Identifier</th>
<th>Check Identifier</th>
</tr>
</thead>
<tbody>
<tr>
<td hidden>1</td>
<td>Test</td>
<td><button (click)="getData($event)">Display</button></td>
<td>View</td>
</tr>
</tbody>
</table>
In app.component.ts, I have set up the following function:
getData(event: any) {
console.info(event);
// Unsure about this part
}
In the given scenario, how can I extract the value 1 from the first cell in the row after clicking the Display button?