AngularJS - 从代码重定向到另一个域

Arn*_*Das 5 javascript redirect angularjs

我已经设置了一个来描述我的问题:Plnkr

实际上我想导航到另一个域中的另一个页面(为按钮单击添加了一个处理程序).但它不起作用.

提前致谢.

更新

window.location.href = "http://google.com";正在工作,但$location.absUrlAngularJS默认的服务不起作用.

Ale*_*N-o 8

$location服务不允许重新加载页面.执行重定向到另一个域的Angular方法是使用该$window服务:

$window.location.href = 'http://google.com'
Run Code Online (Sandbox Code Playgroud)


Cha*_*ani 0

你没有ng-app在你的html上定义。并且也没有在 html 上连接你的控制器。在这里查看更新的小提琴

http://plnkr.co/edit/pPJcWtLrbQOHDT5mXleK?p=preview