I recently added a confirmation feature to the delete button, but I'm facing an issue where the row is not getting removed even though the code seems to be working fine.
HTML
<button class="btn btn-danger" confirmed-click="removeUser($index)" ng-confirm-click="Would you like to delete this user?">del</button>
JavaScript
app.directive('ngConfirmClick', [
function(){
return {
link: function (scope, element, attr) {
var msg = attr.ngConfirmClick || "Are you sure?";
var clickAction = attr.confirmedClick;
element.bind('click',function (event) {
if ( window.confirm(msg) ) {
scope.$eval(clickAction)
}
});
}
};
}
]);
You can view an example here.
Your assistance would be greatly appreciated. Thank you.