Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

angular.js:11383 Error: [$rootScope:infdig] 15 $digest() iterations reached. Aborting! #75

Open
guaicaiboshi opened this issue Sep 20, 2017 · 0 comments

Comments

@guaicaiboshi
Copy link

I found an error in processing data.
<tr ng-repeat="data in BuildData(csv.result)"> <td class="text-center">{{data.height1}}</td> <td class="text-center">{{data.volume1}}</td> <td class="text-center">{{data.height2}}</td> <td class="text-center">{{data.volume2}}</td> <td class="text-center">{{data.height3}}</td> <td class="text-center">{{data.volume3}}</td> <td class="text-center">{{data.height4}}</td> <td class="text-center">{{data.volume4}}</td> </tr>

`$scope.BuildData = function (json) {
console.log(calFlag);
console.log(JSON.stringify(json));
if(json==null||calFlag){
return;
}
calFlag=true;
console.log("2:"+calFlag);
var result = [];
var obj = [];
// console.log($scope.csv.result.length);
for (var i = 0;i<json.length;i++) {

        var element = json[i]; 
        var key = i % 4 + 1;

      //  console.log(JSON.stringify( element)+":" +key);

        obj["height" + key] = element["#高度"];
        obj["volume" + key] = element["体积"];           
        if (key === 4) {
          //  console.log(JSON.stringify(result));
            result.push(obj);
            obj = [];
        }
    }
     if(obj.length>0){
        result.push(obj);
        obj = [];
    }  
    //console.log(JSON.stringify(result));
    calFlag=false;
    return result;
};

angular.js:11383 Error: [$rootScope:infdig] 15 $digest() iterations reached. Aborting!
at angular.js:80
at Scope.$digest (angular.js:14080)
at Scope.$apply (angular.js:14304)
at FileReader.reader.onload (angular-csv-import.js:110)(anonymous function) @ angular.js:11383(anonymous function) @ angular.js:8459$apply @ angular.js:14306reader.onload @ angular-csv-import.js:110
angular.js:80 Uncaught Error: [$rootScope:infdig] 15 $digest() iterations reached. Aborting!(…)(anonymous function) @ angular.js:80$digest @ angular.js:14080$apply @ angular.js:14304reader.onload @ angular-csv-import.js:110`

body is too long (maximum is 65536 characters).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant