i'm using dynamic table with each row having a button, on click of a button, i need data of the respective row button clicked.
I've tried (click) event binding on and i get output as undefined.
<table>
<thead> <tr> <th> Name </th> <th> Company </th> </tr> </thead>
<tr *ngFor = "let employee of employees" (click) = "removeEmployee(row)">
<td> <input type="text" [(ngModel)]= "employee.name"></td>
<td> <input type="text" [(ngModel)] = "employee.companyName"> </td>
</tr>
</table>
.ts file
removeEmployee(tr) {
console.log(tr);
}
expected: on click of button, table row data should output.
actual: undefined is displayed.