Stay on current page when open new tab in angular js

南笙酒味 提交于 2019-12-24 11:33:46

问题


<a class="seecode_button" href="#{{w.CouponID}}" ng-click="newwindow(w)" data-toggle="modal" data-target="#{{w.CouponID}}">CLICK Here</a>

$scope.newwindow = function(w) {
    $window.open(w.LandingPageURL, '_self');
    $window.open('#','_blank');
 };  

I am try to make when some one click on "CLICK Here" then need to open new window but need stay on current tab.

In my code current tab open in page its ok but popup also gone because of it refresh the page . I am using angular js 1.2.17 and for popup i am using bootstrap.js v3.0.0


回答1:


If you don't want to refresh the page, then use an empty href attribute.



来源:https://stackoverflow.com/questions/25216389/stay-on-current-page-when-open-new-tab-in-angular-js

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!