<span ng-mousedown="handleClick($event)"
oncontextmenu="return false"> <!-- use this to prevent context menu -->
\{\{getPointsSpent()}}
</span>
然后在控制器中,您可以执行以下操作:
$scope.handleClick(evt) {
switch(evt.which) {
case 1:
increment(); // this is left click
break;
case 2:
// in case you need some middle click things
break;
case 3:
decrement(); // this is right click
break;
default:
alert("you have a strange mouse!");
break;
}
}