From 01fdf683cf089931d2ccb223eb374d0c52b3d235 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(-) (limited to 'src/ng/http.js') diff --git a/src/ng/http.js b/src/ng/http.js index c958f414..3b2ac8d6 100644 --- a/src/ng/http.js +++ b/src/ng/http.js @@ -286,7 +286,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