I created a confirm button to delete a user from the list, but for some reason it's not working. Could someone please review my JavaScript code to see if there are any mistakes?
Here is the JavaScript code:
$scope.doDelete = function(user) {
var index = $scope.userInfo.users.indexOf(user);
$scope.userInfo.users.splice(index, 1);
$window.location.href = '#/user';
}
HTML Code:
<button class="delete" ng-click="doDelete(person)">Confirm</button>