you could have used the $location.path('/auth/facebook') , then no need to use the $location twice