-
Notifications
You must be signed in to change notification settings - Fork 27.4k
Empty hash at the end of URL causes page reload in HTML5 mode #10397
Comments
OK, so we could probably fix this by comparing after stripping the empty hash. |
As I understand, this code executed only once, during application bootstrap, so issue happens only if we loading page with an empty hash. Next workflow works ok: load page without empty hash -> add some hash -> remove hash -> empty hash kept at the end to prevent page reloading (fixed by #10308). Also, I think you added wrong component label, issue in |
@dritus - would you like to try to fix this? We need a unit test the demonstrates the issue and then the fix, which is to strip empty hashes from the initialUrl before testing. |
I can try to fix this, but right now I don't have time. |
If initial url has empty hash at the end, $location replaces it with url without hash causing page reload Closes angular#10397
If initial url has empty hash at the end, $location replaces it with url without hash causing page reload Closes angular#10397
For example, If I open
http://localhost/#
, page is reloaded tohttp://localhost/
.Looks like issue happens here: https://github.com/angular/angular.js/blob/master/src/ng/location.js#L882
When
http://localhost/#
loaded$location.absUrl()
returnshttp://localhost/
and$browser.url($location.absUrl(), true)
called, which causes page reloading.The text was updated successfully, but these errors were encountered: