mirror of
https://github.com/zhigang1992/angular.js.git
synced 2026-04-23 11:37:38 +08:00
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:
@@ -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);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user