Is there a way to have an element set up so that it performs one action on left-click (ng-click) and then another action on a right-click?
Right now I have something
You can use a directive to bind specific action on right click, using the contextmenu
event :
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});
});
});
};
});
Code example on fiddle