私はAngularJSを使用していますが、ここで少し質問があります。httpInterceptorサービスを作成してajaxRequestsを実行するときにWebページにスピナーを表示しましたが、IEを使用してiFrame内で実行するとこのエラーが発生します。Chrome、Firefoxでは発生しません。インターセプターのコードは次のとおりです。
.factory('httpInterceptor', function ($q, $rootScope) {
return function (promise) {
$rootScope.$$childHead.spinner += 1;
return promise.then(function (response) {
$rootScope.$$childHead.spinner -= 1;
return response;
}, function (response) {
$rootScope.$$childHead.spinner -= 1;
return $q.reject(response);
});
};
}).config(function ($httpProvider) {
$httpProvider.responseInterceptors.push('httpInterceptor');
var spinnerFunction = function (data, headersGetter) {
return data;
};
$httpProvider.defaults.transformRequest.push(spinnerFunction);
});
何らかの理由で、iFrame内でアプリケーションを実行すると、このエラーが表示されます。
Error: 10 $digest() iterations reached. Aborting!
Watchers fired in the last 5 iterations:
これはiFrame内で実行したことが原因なのか、それともpromiseオブジェクトが原因なのか疑問に思いました。
ng-repeatを使用しているときにこのエラーが発生しましたが、その理由はわかりません。同様の問題が発生した場合は、アドバイスをお願いします。ありがとう!