그래서 나는 $ http 요청 및 응답을 가로 채고 있습니다. 응답 오류가 발생하면 $ http 호출을 다시 호출하려고합니다. 문제는 필자의 인터셉터에 $ http 서비스를 주입해야하고 순환 종속성을 생성한다는 것입니다.
retryModule = angular.module('retry-call', [])
retryModule.factory 'RetryCall', ($q, $http)->
# More object keys
'responseError': (response)=>
# Retry request if failed
# I need a different way of invoking $http() to avoid circular dependency
$http(response.config)
$q.reject(response)
retryModule.config ['$httpProvider', ($httpProvider)->
$httpProvider.interceptors.push('RetryCall');
]
감사
확인이 답변 : http://stackoverflow.com/questions/21119016/is-there-a-way-to-request-http-for-an-interceptor/21119959#21119959 –
I 내가 그걸 생각했으면 좋겠어. 이제 나는 어리 석다. 롤. –