我正在使用angular js为所有$htpp调用设置comon标头。
angular.module('sample module').run(function($http) {
$http.defaults.headers.common['token']='ticket' ;
});但我需要为所有的html文件也设置公共头出于安全原因,这将是验证服务。
有没有可能,请提个建议
发布于 2014-05-12 19:36:22
尝试为所有请求设置公共标头,如下所示
angular.module('sample module').config(['$httpProvider', function ($httpProvider) {
$httpProvider.defaults.headers.common['token']='ticket';}]);希望能对你有所帮助。
https://stackoverflow.com/questions/23607777
复制相似问题