I want to get the base path of my Angular app.
Right now I’m doing this: $scope.baseUrl = '$location.host()
But I only get this: /localhost
. My current baseURL is http://localhost:9000/
.
Advertisement
Answer
Try this: $location.$$absUrl
console.log('$location',$location.$$absUrl);
btw /localhost
is your base path, but I guess you meant entire URL.