This repository was 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.4k
Fixes bug when $location.search() is not returning actual search part of current url. #9410
Closed
Conversation
This file contains hidden or 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
The jQuery css() getter functionality utilises getComputedStyle() whereas jqLite only retrieves what is declared inline on an element. Closes angular#7599
This fixes the case when a directive that uses `templateUrl` is used somewhere in the children of a transcluding directive like `ng-repeat`. Fixes angular#9344 Related to angular#8808 Closes angular#9415
IE10/11 have the following problem: When changing the url hash via `history.pushState()` and then reverting the hash via direct changes to `location.href` (or via a link) does not fire a `hashchange` nor `popstate` event. This commit changes the default behavior as follows: Uses `location.href`/`location.replace` if the new url differs from the previous url only in the hash fragment or the browser does not support history API. Use `history.pushState`/ `history.replaceState` otherwise. Fixes angular#9143 Closes angular#9406
Fix jshint error
…mitives When server responds with Content-Type header set to application/json we now properly parse the response as JSON Closes angular#2973
…ingle root node The compiler will no longer throw if a directive template contains comment nodes in addition to a single root node. If a template contains less than 2 nodes, the nodes are unaltered. BREAKING CHANGE: If a template contains directives within comment nodes, and there is more than a single node in the template, those comment nodes are removed. The impact of this breaking change is expected to be quite low. Closes angular#9212 Closes angular#9215
Fixes a failing test on IE9 caused as a side effect of 404b95f being merged before 0656484. The test should have been independent on the browser running it and it is now. Closes angular#9423 Closes angular#9424
@caitp please make the code review. |
@bullgare you really need to provide one (or more) unit tests for any functional change. I can see from reading the code what the specific bug is that you're fixing, but we definitely need a test case |
@@ -480,7 +480,7 @@ LocationHashbangInHtml5Url.prototype = | |||
if (value == null) delete search[key]; | |||
}); | |||
|
|||
this.$$search = search; | |||
this.$$search = extend({}, search); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Don't do this here.
Instead, use search = copy(search, {})
a few lines up, before the forEach()
line (so that we don't make changes to the user-specified object, and so that we get a deep copy)
Thanks, @caitp. |
…rent url. Tests added and implementation fixed.
…lar.js into location.search-setter-fix
This one is closed due to some merge issues. |
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.
The issue appears when we set $location.search() with some object and after that change this object's properties, like that:
There's a little demo onJSBin:
http://jsbin.com/rekana/5/edit?js,output
And another JSBin with behaviour fixed on consumer's side:
http://jsbin.com/rekana/1/edit?js,output
I'm sure it's a bad idea to make someone think of that on the consumer's side.