Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit 1516a69

Browse files
committed
docs($http): add more info about transform function
1 parent 7a77fda commit 1516a69

File tree

1 file changed

+8
-4
lines changed

1 file changed

+8
-4
lines changed

src/ng/http.js

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -245,10 +245,14 @@ function $HttpProvider() {
245245
* - if XSRF prefix is detected, strip it (see Security Considerations section below)
246246
* - if json response is detected, deserialize it using a JSON parser
247247
*
248-
* To override these transformation locally, specify transform functions as `transformRequest`
249-
* and/or `transformResponse` properties of the config object. To globally override the default
250-
* transforms, override the `$httpProvider.defaults.transformRequest` and
251-
* `$httpProvider.defaults.transformResponse` properties of the `$httpProvider`.
248+
* To globally augment or override the default transforms, modify the `$httpProvider.defaults.transformRequest` and
249+
* `$httpProvider.defaults.transformResponse` properties of the `$httpProvider`. These properties are by default an
250+
* array of transform functions, which allows you to `push` or `unshift` a new transformation function into the
251+
* transformation chain. You can also decide to completely override any default transformations by assigning your
252+
* transformation functions to these properties directly without the array wrapper.
253+
*
254+
* Similarly, to locally override the request/response transforms, augment the `transformRequest` and/or
255+
* `transformResponse` properties of the config object passed into `$http`.
252256
*
253257
*
254258
* # Caching

0 commit comments

Comments
 (0)