From 7e5154e7552d1c631fe9fcf5e82f7c9a37fda5ca Mon Sep 17 00:00:00 2001 From: Mr.Raindrop Date: Sun, 22 Sep 2013 20:34:01 +0800 Subject: docs($http): fix adding default header to get request example Initially, `$httpProvider.defaults.headers.get` is `undefined`, so `$httpProvider.defaults.headers.get['My-Header']='value'` will throw an error. Closes #4101 --- src/ng/http.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/ng/http.js b/src/ng/http.js index 7dabfba1..970e42f1 100644 --- a/src/ng/http.js +++ b/src/ng/http.js @@ -251,7 +251,7 @@ function $HttpProvider() { * To add or overwrite these defaults, simply add or remove a property from these configuration * objects. To add headers for an HTTP method other than POST or PUT, simply add a new object * with the lowercased HTTP method name as the key, e.g. - * `$httpProvider.defaults.headers.get['My-Header']='value'`. + * `$httpProvider.defaults.headers.get = { 'My-Header' : 'value' }. * * Additionally, the defaults can be set at runtime via the `$http.defaults` object in the same * fashion. -- cgit v1.2.3