2
Javascript代码...
commonApp = angular.module('commonApp')
.config(function($httpProvider){
$httpProvider.interceptors.push('myHttpInterceptor');
})
.factory('myHttpInterceptor', function($q, $window){
return {
request: function(config){
console.log('Request started'); // LOG AT REQUEST START
return config || $q.when(config);
}
};
});
我认为,该消息应该在XHR请求开始被记录。 但我看到没有xhr请求的日志。
我误解的API?
Plunkr显示问题http://plnkr.co/edit/Ny3jo9?p=preview –