سؤال

I'm trying to create a new Window with AngularJS

var _url = 'http://extern.com/index.html'; 
$window.open(_url);

It always opens a pop-up window, but never a normal window or a new tab. Why?

I use Angular 1.2.9 with Chrome, Firefox and IE10.

My problem is only the chrome 34!

هل كانت مفيدة؟

المحلول

$window.open is really just the same as window.open, which doesn't have much to do with angular. In terms of opening in a new window or tab, that is up to the user, and the settings they have initialised with their browser.

Also the same goes for anchor links with target="_blank".

نصائح أخرى

var _url = 'http://extern.com/index.html'; 
var tabWindowId = window.open('about:blank', '_blank');
tabWindowId.location.href = _url;

Try this

var _url = 'http://extern.com/index.html'; 

window.location.href = _url;
مرخصة بموجب: CC-BY-SA مع الإسناد
لا تنتمي إلى StackOverflow
scroll top