I am trying to remove user from the list. For some reason, splicing is not removing the user from the list. Can any one help me solve this. I am getting the users from a backend API call, and I am using a PUT method to update it when it removes that particular user.
app.js
app.controller('MyCtrl', function($scope, $window) {
$scope.inactive = true;
$scope.confirmedAction = user => {
const index = $scope.userInfo.users.indexOf(user);
$scope.userInfo.users.splice(user, 1);
$window.location.href = '#/user';
};
});