我想在调用 $http 的 get 方法之前添加一些标题。我试过这个:
$http = $originalHttpMethod;
this.$http = function() {
//add headers
return $http
};
$http.get({url:'http://...'});
但我收到此错误:
TypeError: Object function () {return $http} 没有方法'get'。
我想在没有崩溃原始课程的情况下做到这一点。
我该怎么做?