Redirect to new Page in AngularJS using $location

$location won’t help you with external URLs, use the $window service instead:

$window.location.href="http://www.google.com";

Note that you could use the window object, but it is bad practice since $window is easily mockable whereas window is not.

Leave a Comment