Skip to content
This repository was archived by the owner on Apr 12, 2024. It is now read-only.

Commit 49128cc

Browse files
committed
docs($http): add more info about transform function
1 parent 79b51d5 commit 49128cc

File tree

1 file changed

+8
-4
lines changed

1 file changed

+8
-4
lines changed

src/ng/http.js

+8-4
Original file line numberDiff line numberDiff line change
@@ -283,10 +283,14 @@ function $HttpProvider() {
283283
* - if XSRF prefix is detected, strip it (see Security Considerations section below)
284284
* - if json response is detected, deserialize it using a JSON parser
285285
*
286-
* To override these transformation locally, specify transform functions as `transformRequest`
287-
* and/or `transformResponse` properties of the config object. To globally override the default
288-
* transforms, override the `$httpProvider.defaults.transformRequest` and
289-
* `$httpProvider.defaults.transformResponse` properties of the `$httpProvider`.
286+
* To globally augment or override the default transforms, modify the `$httpProvider.defaults.transformRequest` and
287+
* `$httpProvider.defaults.transformResponse` properties of the `$httpProvider`. These properties are by default an
288+
* array of transform functions, which allows you to `push` or `unshift` a new transformation function into the
289+
* transformation chain. You can also decide to completely override any default transformations by assigning your
290+
* transformation functions to these properties directly without the array wrapper.
291+
*
292+
* Similarly, to locally override the request/response transforms, augment the `transformRequest` and/or
293+
* `transformResponse` properties of the config object passed into `$http`.
290294
*
291295
*
292296
* # Caching

0 commit comments

Comments
 (0)