preventDefault
stops the default action the browser makes on that event.
What you want to use is stopPropagation
, which stops the event from bubbling up the event chain.
You can for example use it in a directive like this:
Code:
.directive('myInput', function () {
return {
restrict: 'A',
link: function (scope, element) {
element.bind('click', function (event) {
event.stopPropagation();
});
}
};
});
Markup:
<input type="text" ng-model="customerFilter" my-input>