mirror of
https://github.com/Hopiu/angular.js.git
synced 2026-03-21 17:00:24 +00:00
parseKeyValue and toKeyValue can now handle duplicate values in the query.
```
?x=1&x=2 <-> {x:[1,2]}
```
The algorithm looks like:
1)parseKeyValue looks for presence of obj[key]
2)detects and replaces obj[key] with [obj[key],val]
3)then pushes more duplicates if necessary
4)toKeyValue decodes array correctly
5)(not changed)$location.search({param: 'key'}) still replaces if necessary
6)(not changed)$location.search({param: ['key1', 'key2']}) sets the url with duplicates
BREAKING CHANGE: Before this change:
- `parseKeyValue` only took the last key overwriting all the previous keys;
- `toKeyValue` joined the keys together in a comma delimited string.
This was deemed buggy behavior. If your server relied on this behavior
then either the server should be fixed or a simple serialization of
the array should be done on the client before passing it to $location.
|
||
|---|---|---|
| .. | ||
| directive | ||
| filter | ||
| anchorScroll.js | ||
| animation.js | ||
| animator.js | ||
| browser.js | ||
| cacheFactory.js | ||
| compile.js | ||
| controller.js | ||
| document.js | ||
| exceptionHandler.js | ||
| filter.js | ||
| http.js | ||
| httpBackend.js | ||
| interpolate.js | ||
| locale.js | ||
| location.js | ||
| log.js | ||
| parse.js | ||
| q.js | ||
| rootElement.js | ||
| rootScope.js | ||
| sniffer.js | ||
| timeout.js | ||
| window.js | ||