angular.js:14525错误:[$ rootScope:inprog] http://errors.angularjs.org/1.6.4/$rootScope/inprog?p0=%24apply

时间:2019-01-09 06:50:11

标签: javascript angularjs

我在浏览器控制台中遇到此错误。尽管我的代码可以正常工作,但存在此错误。

angular.js:14525 Error: [$rootScope:inprog] http://errors.angularjs.org/1.6.4/$rootScope/inprog?p0=%24apply
    at angular.js:38
    at n (angular.js:18524)
    at m.$apply (angular.js:18259)
    at HTMLDivElement.<anonymous> (angular.js:26999)
    at HTMLDivElement.dispatch (jquery-3.2.1.min.js:3)
    at HTMLDivElement.q.handle (jquery-3.2.1.min.js:3)
    at m.$scope.validateUploadedDocuments (controller.js:1081)
    at fn (eval at compile (angular.js:15358), <anonymous>:4:195)
    at e (angular.js:26994)
    at m.$eval (angular.js:18161) undefined

这是我的代码..我按照其他帖子的解决方案尝试使用超时,但是它不起作用。任何人都可以提出其他解决方案。调用getUploadedDocument服务时,我在validateUploadedDocuments函数中出现错误。

$scope.validateUploadedDocuments=function(){

        var obj={};

        obj.combiId =  $scope.applicationParams.combiId;
        var indm;
        var ob = localStorageService.get("ageExtraPremiumObj");
        if(!ob) ob = {};

        service.getUploadedDocument(obj).then(function(res) {


                for(var j=0;j<res.data.length;j++){
                    if(res.data[j].documentType=="AadhaarCard" || res.data[j].documentType=="Passport"){
                        if(res.data[j].proofType=="Age Proof"){
                            removeMandetory();
                        }
                        else if(res.data[j].proofType=="Address Proof"){
                           removeMandetory();   
                        }else if(res.data[j].proofType=="ID Proof"){
                            removeMandetory();
                        }
                    }

                 for(var i=0;i<$scope.mandetoryDocuments.length;i++){   

                    if(res.data[j].proofType==$scope.mandetoryDocuments[i].proofType){
                        $scope.mandetoryDocuments[i].uploaded=true;
                    }

                 }
                }


        });         
    };

0 个答案:

没有答案