The solution is to replace:
scope.$eval(clickAction)
by
scope.$apply(clickAction)
Working EXAMPLE.
سؤال
I added a confirmation to the delete button, I noticed that the row has not been removed, and the code work 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)
}
});
}
};
}
]);
This is the EXAMPLE.
Please help.
المحلول