Skip to content

Instantly share code, notes, and snippets.

@ballawala-lv
Created May 7, 2014 19:41
Show Gist options
  • Select an option

  • Save ballawala-lv/b03c5b79c370fd677f6e to your computer and use it in GitHub Desktop.

Select an option

Save ballawala-lv/b03c5b79c370fd677f6e to your computer and use it in GitHub Desktop.
directive to preventDefault and stopPropogation
.directive('stopEvent', function () {
return {
restrict: 'A',
link: function (scope, element, attr) {
element.bind(attr.stopEvent, function (e) {
e.preventDefault();
e.stopPropagation();
});
}
};
})
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment