【发布时间】:2014-05-29 14:59:35
【问题描述】:
早上,
我有一个 $http 拦截器:
app.factory('Unauthed', ['$q', 'alertService',function($q,alertService) {
return {
response: function (response) {
if (response.status == 401)
alertService.error('Authentication failure.',15000);
return response || $q.when(response);
}
};
}]);
这对于所有通过 $http 但不通过 Restangular 的请求运行良好。浏览酸痛的 Restangular 使用 $http 所以我不确定这里发生了什么?
干杯
【问题讨论】:
-
这不应该发生,但也许 restangular 正在使用 .call() 或 .apply() 并且它在名为 response 的变量和名为 response 的方法之间感到困惑?
标签: angularjs restangular