+1
-1
@@ -41,7 +41,7 @@ function $HttpParamSerializerProvider() {
|
||||
if (!params) return '';
|
||||
var parts = [];
|
||||
forEachSorted(params, function(value, key) {
|
||||
if (value === null || isUndefined(value)) return;
|
||||
if (value === null || isUndefined(value) || isFunction(value)) return;
|
||||
if (isArray(value)) {
|
||||
forEach(value, function(v) {
|
||||
parts.push(encodeUriQuery(key) + '=' + encodeUriQuery(serializeValue(v)));
|
||||
|
||||
+4
-1
@@ -2344,7 +2344,6 @@ describe('$http param serializers', function() {
|
||||
expect(defSer({someDate: new Date('2014-07-15T17:30:00.000Z')})).toEqual('someDate=2014-07-15T17:30:00.000Z');
|
||||
expect(jqrSer({someDate: new Date('2014-07-15T17:30:00.000Z')})).toEqual('someDate=2014-07-15T17:30:00.000Z');
|
||||
});
|
||||
|
||||
});
|
||||
|
||||
describe('default array serialization', function() {
|
||||
@@ -2352,6 +2351,10 @@ describe('$http param serializers', function() {
|
||||
it('should serialize arrays by repeating param name', function() {
|
||||
expect(defSer({a: 'b', foo: ['bar', 'baz']})).toEqual('a=b&foo=bar&foo=baz');
|
||||
});
|
||||
|
||||
it('should NOT serialize functions', function() {
|
||||
expect(defSer({foo: 'foov', bar: function() {}})).toEqual('foo=foov');
|
||||
});
|
||||
});
|
||||
|
||||
describe('jquery array and objects serialization', function() {
|
||||
|
||||
Reference in New Issue
Block a user