chore($resource): remove undocumented API
This code has been in the $resource service since 2010, but was never documented and can therefore be removed. It'll save precious bytes! Shout-out to @gkalpak for finding this Closes #16267
This commit is contained in:
@@ -841,11 +841,6 @@ angular.module('ngResource', ['ng']).
|
||||
};
|
||||
});
|
||||
|
||||
Resource.bind = function(additionalParamDefaults) {
|
||||
var extendedParamDefaults = extend({}, paramDefaults, additionalParamDefaults);
|
||||
return resourceFactory(url, extendedParamDefaults, actions, options);
|
||||
};
|
||||
|
||||
return Resource;
|
||||
}
|
||||
|
||||
|
||||
@@ -728,30 +728,6 @@ describe('basic usage', function() {
|
||||
});
|
||||
|
||||
|
||||
it('should bind default parameters', function() {
|
||||
$httpBackend.expect('GET', '/CreditCard/123.visa?minimum=0.05').respond({id: 123});
|
||||
var Visa = CreditCard.bind({verb: '.visa', minimum: 0.05});
|
||||
var visa = Visa.get({id: 123});
|
||||
$httpBackend.flush();
|
||||
expect(visa).toEqualData({id: 123});
|
||||
});
|
||||
|
||||
|
||||
it('should pass all original arguments when binding default params', function() {
|
||||
$httpBackend.expect('GET', '/CancellableCreditCard/123.visa').respond({id: 123});
|
||||
|
||||
var CancellableCreditCard = $resource('/CancellableCreditCard/:id:verb', {},
|
||||
{charge: {method: 'POST'}}, {cancellable: true});
|
||||
var CancellableVisa = CancellableCreditCard.bind({verb: '.visa'});
|
||||
var visa = CancellableVisa.get({id: 123});
|
||||
|
||||
$httpBackend.flush();
|
||||
|
||||
expect(visa.$charge).toEqual(jasmine.any(Function));
|
||||
expect(visa.$cancelRequest).toEqual(jasmine.any(Function));
|
||||
});
|
||||
|
||||
|
||||
it('should support dynamic default parameters (global)', function() {
|
||||
var currentGroup = 'students',
|
||||
Person = $resource('/Person/:group/:id', { group: function() { return currentGroup; }});
|
||||
|
||||
Reference in New Issue
Block a user