【发布时间】:2017-01-05 06:01:22
【问题描述】:
基本上我有一个表格,如果用户点击 id 它会在新标签上打开一个链接。因此,如果用户点击另一个 id,它应该在之前的选项卡上打开,而不是创建另一个新选项卡
$scope.navigationUrl = function (event,item) {
if (event.ctrlKey) {
window.open('link' + item,"_blank"); // in new tab
} else {
$location.path('link' + item); // in same tab , yeah, this is completely wrong
}
;
<tbody>
<tr ng-repeat="case in LastBuild">
<td colspan="1" ng-click="navigationUrl($event,case.id)">{{case.id}}</td>
<td colspan="1">{{case.TimeTaken}}</td>
</tr>
</tbody>
ctrl+click 每次都会在新选项卡上打开链接。但是我怎样才能保持相同的标签只点击?
【问题讨论】:
标签: javascript