From 57ac995b8b7c878261064e41f683986ae1df44d3 Mon Sep 17 00:00:00 2001 From: standup75 Date: Fri, 22 Aug 2014 09:18:39 -0400 Subject: [PATCH] docs(ngResource): document steps to skip default json serialization/deserialization --- src/ngResource/resource.js | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/src/ngResource/resource.js b/src/ngResource/resource.js index a395e2520..10abb6fc8 100644 --- a/src/ngResource/resource.js +++ b/src/ngResource/resource.js @@ -124,10 +124,16 @@ function shallowClearAndCopy(src, dst) { * `{function(data, headersGetter)|Array.}` – * transform function or an array of such functions. The transform function takes the http * request body and headers and returns its transformed (typically serialized) version. + * By default, transformRequest will contain one function that checks if the request data is + * an object and serializes to using `angular.toJson`. To prevent this behavior, set + * `transformRequest` to an empty array: `transformRequest: []` * - **`transformResponse`** – * `{function(data, headersGetter)|Array.}` – * transform function or an array of such functions. The transform function takes the http * response body and headers and returns its transformed (typically deserialized) version. + * By default, transformResponse will contain one function that checks if the response looks like + * a JSON string and deserializes it using `angular.fromJson`. To prevent this behavior, set + * `transformResponse` to an empty array: `transformResponse: []` * - **`cache`** – `{boolean|Cache}` – If true, a default $http cache will be used to cache the * GET request, otherwise if a cache instance built with * {@link ng.$cacheFactory $cacheFactory}, this cache will be used for