>>>>Looks like in our application these problems outweigh the benefits. Is there a way to change absUrl? We do have a service returning baseUrl I could have used.
>>>
>>>As per the docs there are parts of the absUrl that you can change : path, search and hash ( or url which is all of the previous)
>>>You cannot change protocol, host and port.
>>>Not sure why you would want to change any of the setter only items anyway ?
>>
>>Unfortunately, in the default mode the url returns / and path returns nothing. The absUrl returns the full correct path.
>
>I don't see that behaviour. What is the absolute url (in both Hashbang and HTML5 modes) and what do expect to see in $location.path() ?
>
Without any setting of $locationProvider I am getting
http://localhost:9999/Salespoints/Preferences - for absUrl
and nothing for $location.path()
when I uncomment these lines in app.js
app.config(['$locationProvider', function ($locationProvider) {
$locationProvider.html5Mode(true);
$locationProvider.hashPrefix('!');
}]);
I get the following:
http://localhost:9999/Salespoints/Preferences
/Salespoints/Preferences
So, in the second case I do get the /Salespoint/Preferences and I do get correct behavior when I use $location.path('/');
But I need to get the correct behavior with these lines commented out in app.js because it causes too many problems for our application.
For now I switched back to window.location.href= userService.baseUrl;
If it's not broken, fix it until it is.
My Blog