Skip to content
This repository was archived by the owner on Apr 12, 2024. It is now read-only.

Commit 85f40a1

Browse files
committed
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
1 parent b919a27 commit 85f40a1

File tree

2 files changed

+0
-29
lines changed

2 files changed

+0
-29
lines changed

src/ngResource/resource.js

-5
Original file line numberDiff line numberDiff line change
@@ -841,11 +841,6 @@ angular.module('ngResource', ['ng']).
841841
};
842842
});
843843

844-
Resource.bind = function(additionalParamDefaults) {
845-
var extendedParamDefaults = extend({}, paramDefaults, additionalParamDefaults);
846-
return resourceFactory(url, extendedParamDefaults, actions, options);
847-
};
848-
849844
return Resource;
850845
}
851846

test/ngResource/resourceSpec.js

-24
Original file line numberDiff line numberDiff line change
@@ -728,30 +728,6 @@ describe('basic usage', function() {
728728
});
729729

730730

731-
it('should bind default parameters', function() {
732-
$httpBackend.expect('GET', '/CreditCard/123.visa?minimum=0.05').respond({id: 123});
733-
var Visa = CreditCard.bind({verb: '.visa', minimum: 0.05});
734-
var visa = Visa.get({id: 123});
735-
$httpBackend.flush();
736-
expect(visa).toEqualData({id: 123});
737-
});
738-
739-
740-
it('should pass all original arguments when binding default params', function() {
741-
$httpBackend.expect('GET', '/CancellableCreditCard/123.visa').respond({id: 123});
742-
743-
var CancellableCreditCard = $resource('/CancellableCreditCard/:id:verb', {},
744-
{charge: {method: 'POST'}}, {cancellable: true});
745-
var CancellableVisa = CancellableCreditCard.bind({verb: '.visa'});
746-
var visa = CancellableVisa.get({id: 123});
747-
748-
$httpBackend.flush();
749-
750-
expect(visa.$charge).toEqual(jasmine.any(Function));
751-
expect(visa.$cancelRequest).toEqual(jasmine.any(Function));
752-
});
753-
754-
755731
it('should support dynamic default parameters (global)', function() {
756732
var currentGroup = 'students',
757733
Person = $resource('/Person/:group/:id', { group: function() { return currentGroup; }});

0 commit comments

Comments
 (0)