是否可以使用 angularjs 拦截器阻止请求?
$provide.factory('myHttpInterceptor', function($q, someService) {
return {
'request': function(config) {
// here I'd like to cancel a request depending of some conditions
}
}
});
$httpProvider.interceptors.push('myHttpInterceptor');