I have a webapp with multiple controllers. I'm setting the defaults headers of the $http
service in a callback in one of my controllers (via http.defaults.headers.common['headername']
). However, those headers do not get set in subsequent calls from other controllers. Do I have to set them for each controller I have or is one time enough?
相关问题
- Angular RxJS mergeMap types
- angularJS: ui-router equivalent to $location.searc
- Google Apps Script: testing doPost() with cURL
- How to instantiate Http service in main.ts manuall
- Separate AngularJS Controllers Into Separate Files
相关文章
- C#使用http访问网络,有办法用指定网卡访问网络嘛?
- Passing variable through URL with angular js
- Watch entire object (deep watch) with AngularJS
- Angular ng-if change span text
- Is a unicode user agent legal inside an HTTP heade
- Can ng-show directive be used with a delay
- AngularJS $routeParams vs $stateParams
- Multiple parameters in AngularJS $resource GET
You should use one of two methods:
Set $http.defaults.headers in run block e.g.
Use interceptor