2
200 개 상태마다 로깅 메소드를 실행하는 간단한 인터셉터가 필요합니다. 이것은 설치하기 쉽지만, 이제는 모든 Angular 템플릿이 $ httpProvider를 통해로드되어 200 개의 인터셉터를 트리거한다는 것을 알게되었습니다. 템플릿로드와 실제 API 호출을 구별하는 방법은 무엇입니까?
$httpProvider.interceptors.push(function() {
return {
response: function(response) {
if(response.status === 200) console.log(response);
return response;
}
};
});
a-ha, 정말 고마워요. – diplosaurus