I have a link that should call a $scope-function which causes another view to bei displayed.
But I also want that the User can rightclick onto that Link and open it into a new window or bookmark this.
So this is the (non-working) html:
<a ng-click="OpenSubsite(singleitem.Id)" href="{{GetUrl(singleItem.Id)}}">{{singleItem.Title}}</a>
The controller contains the following Code:
$scope.OpenSubSite=function(id) {
$scope.LoadItem(id);
}
$scope.GetUrl=function(id) {
return "showitem.html#id="+id;
}
Both methods alone work fine. Just not in the combination I want. I want the "OpenSubSite()
" to be called when clicking onto that URL but when doing a rightclick ("open in new tab" or "add to favorites") the "GetUrl()
"-Returnvalue should be used instead.
But with this code, the URL from GetUrl() is always opened even on left Mousebutton click,
Is there a way to make this happen?