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
This commit is contained in:
Mr.Raindrop 2013-09-22 20:34:01 +08:00 committed by Pete Bacon Darwin
parent ec6b1cfaba
commit 7e5154e755

View file

@ -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.