0

how to avoid the link to be blocked by browser popup?

my demo work but it only open the first link, I wonder.. I used foreach..

http://plnkr.co/edit/m8m2I9dqE2kF1H1nzxJT

user3522725
  • 387
  • 1
  • 4
  • 13
  • Why do you reopen the same question with a new user? [$window to open multiple links blocked by pop up](http://stackoverflow.com/questions/24355471/window-to-open-multiple-links-blocked-by-pop-up) – t.niese Jun 22 '14 at 22:29

1 Answers1

0

Added value, key to CB function args and used that to get at the link value, also added the window name attribute telling open function to open blank window each time:

angular.forEach($scope.links, function(value, key){
    $window.open("link.html/?" + value.link, '_blank');
});

$scope.links.link was returning "undefined" in that location.

bloodyKnuckles
  • 11,551
  • 3
  • 29
  • 37