angular.js - Do the $http method and $httpProvider in angularjs have the same meaning?
天蓬老师2017-05-15 17:03:46
0
2
562
Do the $http method and $httpProvider in angularjs have the same meaning? When I read a book, it was said that $http method is used to interact with the server, but $httpProvider is used. Is this a concept?
Use $httpProvider to change the default behavior of the $http service.
$httpProvider is used to set the configuration of $http requests, such as disabling cache globally, adding headers, etc.
https://docs.angularjs.org/api/ng/provider/$httpProvider
Configure $http, that is, you need to use $httpProvider in the config function