Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
confirm click
(function () {
'use strict';
angular
.module('c2k')
.directive('ngReallyClick', [ngReallyClickFunction]);
function ngReallyClickFunction() {
return {
restrict: 'A',
link: linkFn
};
function linkFn(scope, element, attrs) {
element.bind('click', function(){
var message = attrs.ngReallyMessage;
if(message && confirm(message)){
scope.$apply(attrs.ngReallyClick)
}
})
}
}
}());
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment