mirror of
https://github.com/zhigang1992/angular.js.git
synced 2026-04-24 03:55:49 +08:00
fix($location): remove query args when passed in object
Query args will be removed from $location search object if they are passed in as null or undefined object properties Closes #6565
This commit is contained in:
@@ -117,6 +117,15 @@ describe('$location', function() {
|
||||
});
|
||||
|
||||
|
||||
it('search() should remove multiple parameters', function() {
|
||||
url.search({one: 1, two: true});
|
||||
expect(url.search()).toEqual({one: 1, two: true});
|
||||
url.search({one: null, two: null});
|
||||
expect(url.search()).toEqual({});
|
||||
expect(url.absUrl()).toBe('http://www.domain.com:9877/path/b#hash');
|
||||
});
|
||||
|
||||
|
||||
it('search() should handle multiple value', function() {
|
||||
url.search('a&b');
|
||||
expect(url.search()).toEqual({a: true, b: true});
|
||||
|
||||
Reference in New Issue
Block a user