aboutsummaryrefslogtreecommitdiffstats
path: root/src/ngResource/resource.js
diff options
context:
space:
mode:
authorIgor Minar2012-11-11 12:07:26 +0100
committerIgor Minar2012-11-11 12:07:26 +0100
commit29541e735d3c01acc2ff18e371858e9eba14fc0c (patch)
tree4de39db3f8b54ea63d59e0b5d19f036ec5dc889c /src/ngResource/resource.js
parentf5b567d44b93d3885cf4ee7be5480d66ce2d4fb0 (diff)
downloadangular.js-29541e735d3c01acc2ff18e371858e9eba14fc0c.tar.bz2
revert($resource): support custom headers per action
This reverts commit b936e52874fe0173c6d4ba0a84f45deac67518ac. This commit introduces a feature and should haven't been merged into the stable branch.
Diffstat (limited to 'src/ngResource/resource.js')
-rw-r--r--src/ngResource/resource.js10
1 files changed, 4 insertions, 6 deletions
diff --git a/src/ngResource/resource.js b/src/ngResource/resource.js
index ab5dc52a..4bd845f0 100644
--- a/src/ngResource/resource.js
+++ b/src/ngResource/resource.js
@@ -36,8 +36,8 @@
* @param {Object.<Object>=} actions Hash with declaration of custom action that should extend the
* default set of resource actions. The declaration should be created in the following format:
*
- * {action1: {method:?, params:?, isArray:?, headers:?},
- * action2: {method:?, params:?, isArray:?, headers:?},
+ * {action1: {method:?, params:?, isArray:?},
+ * action2: {method:?, params:?, isArray:?},
* ...}
*
* Where:
@@ -49,7 +49,6 @@
* - `params` – {object=} – Optional set of pre-bound parameters for this action.
* - isArray – {boolean=} – If true then the returned object for this action is an array, see
* `returns` section.
- * - `headers` – {object=} – Optional HTTP headers to send
*
* @returns {Object} A resource "class" object with methods for the default set of resource actions
* optionally extended with custom `actions`. The default set contains these actions:
@@ -131,7 +130,7 @@
* The object returned from this function execution is a resource "class" which has "static" method
* for each action in the definition.
*
- * Calling these methods invoke `$http` on the `url` template with the given `method`, `params` and `headers`.
+ * Calling these methods invoke `$http` on the `url` template with the given `method` and `params`.
* When the data is returned from the server then the object is an instance of the resource type and
* all of the non-GET methods are available with `$` prefix. This allows you to easily support CRUD
* operations (create, read, update, delete) on server-side data.
@@ -370,8 +369,7 @@ angular.module('ngResource', ['ng']).
$http({
method: action.method,
url: route.url(extend({}, extractParams(data, action.params || {}), params)),
- data: data,
- headers: extend({}, action.headers || {})
+ data: data
}).then(function(response) {
var data = response.data;