I have directive that does something like so:
app.directive('custom', function(){
return {
restrict:'A',
link: function(scope, element){
element.bind('click', function(){
alert('want to prevent this');
});
}
}
});
yes, it's necessary to do jQuery-way binding for this case.
And now I want to stop this event(click) propagation if some condition met.
Tried to do:
$event.stopPropagation();
$event.preventDefault();
but it did not help.
here fiddle for example - http://jsfiddle.net/STEVER/5bfkbh7u/