Warning: file_get_contents(/data/phpspider/zhask/data//catemap/9/javascript/450.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Internet explorer 错误:已达到10$digest()迭代。流产!使用httpInterceptor(iFrame)IE_Internet Explorer_Http_Request_Angularjs_Digest - Fatal编程技术网

Internet explorer 错误:已达到10$digest()迭代。流产!使用httpInterceptor(iFrame)IE

Internet explorer 错误:已达到10$digest()迭代。流产!使用httpInterceptor(iFrame)IE,internet-explorer,http,request,angularjs,digest,Internet Explorer,Http,Request,Angularjs,Digest,我正在使用AngularJS,我有一个小问题。我刚让我的httpInterceptor服务在执行ajaxRequests时在网页上显示一个微调器,但当我使用IE在iFrame中运行它时,它会给我带来这个错误;使用Chrome、Firefox时不会发生这种情况。以下是拦截器的代码: .factory('httpInterceptor', function ($q, $rootScope) { return function (promise) { $root

我正在使用AngularJS,我有一个小问题。我刚让我的httpInterceptor服务在执行ajaxRequests时在网页上显示一个微调器,但当我使用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时看到这个错误,但我还没有找到原因。如果你有类似的问题,请给我一些建议。谢谢

在引用$rootScope.$$childHead时,看起来您正在使用angular。如果这是一个内部构造,那么这很可能是您的问题。你似乎在用angular来更新同一个字段

在引用$rootScope.$$childHead时,看起来您正在使用angular。如果这是一个内部构造,那么这很可能是您的问题。你似乎在用angular来更新同一个字段

嗨,丹,谢谢你的回答。关于$rootScope。$$childHead,我使用它是因为它是我在控制器中使用的$scope的引用。如果我只使用$rootScope,它不会从该控制器更新$scope.spinner。你知道访问该范围的另一个选项吗?嗨,Omar,与其访问angular的内部,为什么不在子范围中创建一个侦听器(使用$on)并从rootScope使用$broadcast来通知呢。只是个主意。嗨,丹,谢谢你的回答。关于$rootScope。$$childHead,我使用它是因为它是我在控制器中使用的$scope的引用。如果我只使用$rootScope,它不会从该控制器更新$scope.spinner。你知道访问该范围的另一个选项吗?嗨,Omar,与其访问angular的内部,为什么不在子范围中创建一个侦听器(使用$on)并从rootScope使用$broadcast来通知呢。只是个主意。