This directive:
angular.module('WizmoApp', [])
.directive('confirmClick', function() {
return {
priority: -1,
restrict: 'A',
link: function(scope, element, attrs){
element.bind('click', function(e){
var message = attrs.ngConfirmClick;
// confirm() requires jQuery
if(message && !confirm(message)){
//e.stopImmediatePropagation();
//e.preventDefault();
}
});
}
};
});
, which I'm trying to transcribe from here: Confirmation dialog on ng-click - AngularJS is enough to bring my app to a screeching halt. No display on-screen, no js errors, no nothing, just a blank sacreen.
This is how I'm using it:
<tr class=""
ng-repeat="package in adminManifestVm.Manifest | orderBy:'Id' track by $index"
ng-click="adminManifestVm.debinPackage(package.Id);"
ng-confirm-click="Are you sure you want to debin this?">
No idea how to debug a directive, let alone write one.
[ EDIT ] I just noticed that, in the example, the directive is actually called ngConfirmClick. Changed it, but makes no difference.