我想在$http
调用后打开一个新标签页
。目前,即使是在用户点击之后进行调用,弹出窗口阻止程序也不允许创建新标签页
。
HTML:
<div ng-controller="ExampleController">
<button ng-click="openNewTab()">Open new tab</button>
</div>
控制器
.controller('ExampleController', ['$scope','$http', function($scope,$http) {
$scope.openNewTab = function(e) {
$http.get("test.com").finally(()=>{
window.open();
});
};
}]);