This repository has been archived by the owner on Apr 12, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 27.5k
fix($location): return '/' for root path in hashbang mode #5712
Closed
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Before this change, on the root of the application, $location.path() would return the empty string. Following this change, it will always return a root of '/'. Closes angular#5650
ghost
assigned IgorMinar
Jan 10, 2014
IgorMinar
added a commit
that referenced
this pull request
Jan 10, 2014
This reverts commit 63cd873. The change breaks existing tests of Google apps. The problem is that while we tried to avoid adding #/ to window.location.href unnecessarily we failed doing so. Likely because by setting $path, at some point (during a digest) we try to check if $location changed and we mistake the default '/' with an explicit settign of the path via the `path()` method. This results in us writing the url with '#/' into $browser.url() which updates the window.location by adding "#/" to the url - something we tried to avoid in the first place. I'll reopen PR #5712.
I hacked up an incomplete fix for the issue due to which the commit got reverted:
it seems that we'll need to change all tests in Angular that expect I consider this to be a breaking change, so we should reschedule this fix for 1.3 |
Ah, understood |
Just a headsup, I'm seeing this being listed inside the 1.2.8 change log. |
Yes, unfortunately the reversion doesn't remove it from the changelog, and doesn't get listed itself. hmm |
jamesdaily
pushed a commit
to jamesdaily/angular.js
that referenced
this pull request
Jan 27, 2014
Before this change, on the root of the application, $location.path() would return the empty string. Following this change, it will always return a root of '/'. Closes angular#5650 Closes angular#5712
jamesdaily
pushed a commit
to jamesdaily/angular.js
that referenced
this pull request
Jan 27, 2014
This reverts commit 63cd873. The change breaks existing tests of Google apps. The problem is that while we tried to avoid adding #/ to window.location.href unnecessarily we failed doing so. Likely because by setting $path, at some point (during a digest) we try to check if $location changed and we mistake the default '/' with an explicit settign of the path via the `path()` method. This results in us writing the url with '#/' into $browser.url() which updates the window.location by adding "#/" to the url - something we tried to avoid in the first place. I'll reopen PR angular#5712.
jamesdaily
pushed a commit
to jamesdaily/angular.js
that referenced
this pull request
Jan 27, 2014
Before this change, on the root of the application, $location.path() would return the empty string. Following this change, it will always return a root of '/'. Closes angular#5650 Closes angular#5712
jamesdaily
pushed a commit
to jamesdaily/angular.js
that referenced
this pull request
Jan 27, 2014
This reverts commit 63cd873. The change breaks existing tests of Google apps. The problem is that while we tried to avoid adding #/ to window.location.href unnecessarily we failed doing so. Likely because by setting $path, at some point (during a digest) we try to check if $location changed and we mistake the default '/' with an explicit settign of the path via the `path()` method. This results in us writing the url with '#/' into $browser.url() which updates the window.location by adding "#/" to the url - something we tried to avoid in the first place. I'll reopen PR angular#5712.
Just as a note, #5977 has a tiny bit of code in it which will need to be altered here due to the breaking change. |
petebacondarwin
force-pushed
the
master
branch
from
September 16, 2014 11:25
02dc2aa
to
fd2d6c0
Compare
jeffbcross
force-pushed
the
master
branch
2 times, most recently
from
October 8, 2014 19:46
abdaab7
to
30996f8
Compare
jeffbcross
force-pushed
the
master
branch
2 times, most recently
from
October 10, 2014 17:37
e8dc429
to
e83fab9
Compare
petebacondarwin
force-pushed
the
master
branch
from
October 19, 2014 10:57
4dd5a20
to
998c61c
Compare
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Before this change, on the root of the application, $location.path() would return the empty string. Following this change, it will always return a root of '/'.
Closes #5650