我有一个AngularJS
应用,其中包含这个简单的http-interceptor
:
'use strict';
app.factory('myInterceptorService', ['$q','$location', function ($q,$location) {
var myInterceptorServiceFactory = {};
var _request = function (config) {
// some code
}
var _responseError = function (rejection) {
// some code
}
myInterceptorServiceFactory.request = _request;
myInterceptorServiceFactory.responseError = _responseError;
return myInterceptorServiceFactory;
}]);
我按照这样注册拦截器:
app.config(function ($httpProvider) {
$httpProvider.interceptors.push('myInterceptorService');
});
但是,我无法在AngularDart
中以任何方式执行此操作。请问有什么建议吗?