简体   繁体   English

angularjs:如何重定向到不同的网址?

[英]angularjs: how to redirect to a different url?

In my angularjs app I want to redirect to a different site / domain.在我的 angularjs 应用程序中,我想重定向到不同的站点/域。 I am using:我在用:

$location.url(someOtherDomain);

How can I redirect to this url from my angularjs app?如何从我的 angularjs 应用程序重定向到这个 url?

您可以使用可以注入的$window对象:

return $window.location = 'https://someurl.com'

您可以使用以下方法:

$window.open('https://someurl.com','_blank');

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM