Reputation: 658
I am using Angularjs. In my application i have one link say(opentab).I have added ng-click event on this
<a href="javascript:void(0);" ng-click="clickevent()">opentab</a>
I want when users right click on "opentab" and select "open link in new tab" it call clickevent function
Thanks
Upvotes: 0
Views: 1650
Reputation: 727
You can not detect that, but you can detect the ctrl + click, cmd + click etc. something like this.
HTML
<div ng-app="myApp" ng-controller="mainController">
<a href="javascript:void(0);" href="javascript:void(0);" ng-click="clickevent($event)">Opentab</a>
</div>
JS
var app = angular.module("myApp", []);
app.controller("mainController", function($scope) {
$scope.clickevent = function($event){
if (event.ctrlKey || event.shiftKey || event.metaKey || $event.which == 2) {
alert("aa");
}
}
});
Hope it help, Cheers :)
Upvotes: 1