Basically I want my app to open links in new tab/page when user holds down Ctrl (on linux windows), Cmd (on OSX). What is the way to go.
Note: I cannot get rid of ng-click. the application uses it various method calls within scope.
Try this:
In HTML,
<div ng-click="gotoPageOrFunc($event)"></div>
In JS,
$scope.gotoPageOrFunc = function(event){
if (event.ctrlKey==1){
// Use windows.location or your link.
}else{
// Your actual functionalities.
}
}
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With