I am facing an issue where I am trying to delete multiple objects from an array by selecting the checkbox on a table row. However, I am only able to delete one item at a time. How can I resolve this problem and successfully delete multiple selected objects?
Here is a demo for reference: https://stackblitz.com/edit/angular-ivy-fflhjh?file=src%2Fapp%2Fapp.component.ts,src%2Fapp%2Fapp.component.html
Snippet of app.component.ts:
removeSelectedRow() {
this.data2.forEach((value, index) => {
console.log(value);
if (value.isSelected === true) {
this.data2.splice(index, 1);
}
});
}