javascript - Cannot delete property '1' of [object Array] - Stack Overflow
I've faced the same issue and according to this article the problem is that user array has non configurable properties. I suppose angular Inputs are set as non configurable. When you do: this.users = this.usersInput
you simply pass the reference of input to this.users
. The solution is to simply copy input array before splicing. In your case:
this.users = [...this.usersInput];
Btw. do it in deleteUser method instead of afterViewInit with local variable. You do not need two class props referring to the same object.
Không có nhận xét nào:
Đăng nhận xét