Reputation: 1
My table has one input column which is type = numeric. When I passed it's value for its .ts file I have used both keyup and change events. This includes in the one of column. Now i need to pass the row index through above both events. How can I do it?
Contribution Percentage %Upvotes: -1
Views: 628
Reputation: 180
you can use index in row like this
<ng-container matColumnDef="name">
<th mat-header-cell *matHeaderCellDef> Name </th>
<td mat-cell *matCellDef="let element let i= index"> <input (keyup)=function(i)></td>
</ng-container>
you can also read about trackBy
Upvotes: 1