Reputation: 3728
I've set up one plunker to describe my problem: Plnkr
Actually I want to navigate to another page in another domain (added one handler to a button click). But it's not working.
Thanks in advance.
Update
window.location.href = "http://google.com";
is working but $location.absUrl
service from AngularJS default is not working.
Upvotes: 5
Views: 12385
Reputation: 3993
The $location
service does not allow to reload the page. The Angular way to perform a redirection to another domain is to use the $window
service:
$window.location.href = 'http://google.com'
Upvotes: 8
Reputation: 125
Unfortunately, the $location service allow you only to change the relative path of your web application whether you want to be redirected to another site you have to use window.location.href
Upvotes: 2
Reputation: 42669
You not not defined ng-app
on you html. And also not wired up your controller on html. See updated fiddle here
http://plnkr.co/edit/pPJcWtLrbQOHDT5mXleK?p=preview
Upvotes: 0