It's very easy to open two URL one by one by using interval but in the same tab.
e.g.
<div ng-click="openTwoUrl()">Click Me</div>
JS:
$scope.openTwoUrl=function(){
$window.location.href='www.linkone.com';
//Below will wait for the above link to be fully loaded.
var interval = setInterval(function() {
if(document.readyState === 'complete') {
$window.location.href='linktwo.com';
clearInterval(interval);
}
}, 100);
}
But my requirement is that I want to open these URL to be open one by one in a new tab.
So to open a new tab I use $window.open('www.firstlink.com')
and immediately a new tab is opened and now I want that in that newly opened tab my second URL i.e www.secondlink.com
to be loaded.
Searched a lot but didn't found anything. Any help or suggestion would be greatly appreciated.
NOTE:
JavaScript: location.href to open in new window/tab?
This question doesn't give me the solution to my problem