Problem is that ng-click
works on so event if cancelTicket === false
it still fires ng-click
. How can I stop that?
My solution has been to use an html directive with an attribute used instead of ng-click, so that
and the directive defined as follow:
1) template:
2) controller:
angular.module('module')
.directive('htmlTagDirective',function() {
return {
restrict:'E',
templateUrl:'template.html',
scope:{
disabled:'=',
click: '&'
},
link:function(scope,element){
scope.onClick = function() {
if (!(scope.disabled)) {
scope.newClick();
}
};
}
};
});