Skip to content

Commit 57ac995

Browse files
standup75jeffbcross
authored andcommitted
docs(ngResource): document steps to skip default json serialization/deserialization
1 parent d396f42 commit 57ac995

1 file changed

Lines changed: 6 additions & 0 deletions

File tree

src/ngResource/resource.js

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -124,10 +124,16 @@ function shallowClearAndCopy(src, dst) {
124124
* `{function(data, headersGetter)|Array.<function(data, headersGetter)>}` –
125125
* transform function or an array of such functions. The transform function takes the http
126126
* request body and headers and returns its transformed (typically serialized) version.
127+
* By default, transformRequest will contain one function that checks if the request data is
128+
* an object and serializes to using `angular.toJson`. To prevent this behavior, set
129+
* `transformRequest` to an empty array: `transformRequest: []`
127130
* - **`transformResponse`** –
128131
* `{function(data, headersGetter)|Array.<function(data, headersGetter)>}` –
129132
* transform function or an array of such functions. The transform function takes the http
130133
* response body and headers and returns its transformed (typically deserialized) version.
134+
* By default, transformResponse will contain one function that checks if the response looks like
135+
* a JSON string and deserializes it using `angular.fromJson`. To prevent this behavior, set
136+
* `transformResponse` to an empty array: `transformResponse: []`
131137
* - **`cache`** – `{boolean|Cache}` – If true, a default $http cache will be used to cache the
132138
* GET request, otherwise if a cache instance built with
133139
* {@link ng.$cacheFactory $cacheFactory}, this cache will be used for

0 commit comments

Comments
 (0)