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

Skip to content

Commit 7e5154e

Browse files
MrRaindroppetebacondarwin
authored andcommitted
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 angular#4101
1 parent ec6b1cf commit 7e5154e

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/ng/http.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -251,7 +251,7 @@ function $HttpProvider() {
251251
* To add or overwrite these defaults, simply add or remove a property from these configuration
252252
* objects. To add headers for an HTTP method other than POST or PUT, simply add a new object
253253
* with the lowercased HTTP method name as the key, e.g.
254-
* `$httpProvider.defaults.headers.get['My-Header']='value'`.
254+
* `$httpProvider.defaults.headers.get = { 'My-Header' : 'value' }.
255255
*
256256
* Additionally, the defaults can be set at runtime via the `$http.defaults` object in the same
257257
* fashion.

0 commit comments

Comments
 (0)