From 49128cc1005f0bea6074107c1098b6866eed74f5 Mon Sep 17 00:00:00 2001 From: Igor Minar Date: Wed, 6 Mar 2013 11:20:30 -0800 Subject: docs($http): add more info about transform function --- src/ng/http.js | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) (limited to 'src') diff --git a/src/ng/http.js b/src/ng/http.js index 4288e7c1..99c1fff3 100644 --- a/src/ng/http.js +++ b/src/ng/http.js @@ -283,10 +283,14 @@ function $HttpProvider() { * - if XSRF prefix is detected, strip it (see Security Considerations section below) * - if json response is detected, deserialize it using a JSON parser * - * To override these transformation locally, specify transform functions as `transformRequest` - * and/or `transformResponse` properties of the config object. To globally override the default - * transforms, override the `$httpProvider.defaults.transformRequest` and - * `$httpProvider.defaults.transformResponse` properties of the `$httpProvider`. + * To globally augment or override the default transforms, modify the `$httpProvider.defaults.transformRequest` and + * `$httpProvider.defaults.transformResponse` properties of the `$httpProvider`. These properties are by default an + * array of transform functions, which allows you to `push` or `unshift` a new transformation function into the + * transformation chain. You can also decide to completely override any default transformations by assigning your + * transformation functions to these properties directly without the array wrapper. + * + * Similarly, to locally override the request/response transforms, augment the `transformRequest` and/or + * `transformResponse` properties of the config object passed into `$http`. * * * # Caching -- cgit v1.2.3