feat($resource): allow props beginning with $ to be used on resources

BREAKING CHANGE:

If you expected `$resource` to strip these types of properties before,
you will have to manually do this yourself now.
This commit is contained in:
rodyhaddad
2014-02-15 01:04:13 -05:00
committed by Brian Ford
parent c054288c97
commit d3c50c8456
2 changed files with 21 additions and 0 deletions

View File

@@ -493,6 +493,13 @@ angular.module('ngResource', ['ng']).
shallowClearAndCopy(value || {}, this);
}
Resource.prototype.toJSON = function () {
var data = extend({}, this);
delete data.$promise;
delete data.$resolved;
return data;
};
forEach(actions, function (action, name) {
var hasBody = /^(POST|PUT|PATCH)$/i.test(action.method);