Angular: Empty Fiddle
http://angularjs.org/
HTML
<script src="http://code.angularjs.org/angular-1.0.1.js"></script>
<div ng-controller="MyCtrl">
<button ng-click="open()">Click here</button>
</div>
JavaScript
var myApp = angular.module('myApp',[]);
myApp.controller('MyCtrl', function($scope, $window, $http) {
$scope.open = function() {
var windowy = $window.open('', '_blank');
console.log('1');
console.log(windowy);
$http.get('http://httpbin.org/delay/0').then(function(response){
var windowx = $window.open('', '_blank');
console.log('2');
console.log(windowx);
});
}
});