Skip to content

Instantly share code, notes, and snippets.

@EpokK
Created July 18, 2013 13:26
Show Gist options
  • Save EpokK/6029276 to your computer and use it in GitHub Desktop.
Save EpokK/6029276 to your computer and use it in GitHub Desktop.
ngRightClick
app.directive('ngRightClick', function($parse) {
return function(scope, element, attrs) {
var fn = $parse(attrs.ngRightClick);
element.bind('contextmenu', function(event) {
scope.$apply(function() {
event.preventDefault();
fn(scope, {$event:event});
});
});
};
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment