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 = "";
is working but $location.absUrl
service from AngularJS default is not working.
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.";
is working but $location.absUrl
service from AngularJS default is not working.
3 Answers
Reset to default 8The $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.'
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
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