From 3244f03c214406d8a381eee8fd0f47748e9e6c4c Mon Sep 17 00:00:00 2001 From: Jen Bourey Date: Fri, 4 Oct 2013 12:02:18 -0700 Subject: [PATCH] fix(ngResource): Remove request body from $delete Prevent the obj.$delete instance method from sending the resource as the request body. This commit uses the existing hasBody boolean to only set httpConfig.data for methods which should have a request body. Closes #4280 --- src/ngResource/resource.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/ngResource/resource.js b/src/ngResource/resource.js index a86c00ec4dd6..d330f737e4c6 100644 --- a/src/ngResource/resource.js +++ b/src/ngResource/resource.js @@ -466,7 +466,7 @@ angular.module('ngResource', ['ng']). } }); - httpConfig.data = data; + if (hasBody) httpConfig.data = data; route.setUrlParams(httpConfig, extend({}, extractParams(data, action.params || {}), params), action.url); var promise = $http(httpConfig).then(function(response) {