I am currently working with an HTML table that has default checked rows.
<table>
<tr>
<th></th>
<th>Id</th>
<th>Name</th>
<th>Initial</th>
</tr>
<tr *ngFor="let name of names; let i = index">
<td><input type="checkbox" [checked]="chk" (change)="onTaChange(name, $event.target.checked,i)"></td>
<td>{{name.id}}</td>
<td>{{name.Fname}}</td>
<td>{{name.Initial}}</td>
</tr>
</table>
I have created another array to store unchecked/checked objects. In the onTaChange() method, I pass the index in splice() to remove the object at that index (unchecked row in the table). However, the rows(objects) are getting removed even if they belong to different arrays of objects.
My goal is to have a second array containing only the checked/unchecked rows of objects. Can anyone provide assistance with this?