After following the basic idea of this answer on SO Angular.js ng-repeat: opening/closing elements after x iterations
I'm grouping items and wrapping them in a div, and getting the following error Error: 10 $digest() iterations reached. Aborting!
Watchers fired in the last 5 iterations:
This leads me to believe that Angular is expecting 10 repeats and is only registering 5. However, the output looks correct, all 10 items are shown.
I'm building a windows start screen type layout, where some of the tiles will be single, others double width. I'm doing some calculations to wrap the tiles in a div.
The filter I've built is
app.filter('partition', function() {
var part = function(arr, size) {
if ( 0 === arr.length ) return [];
var applist=[];
var partlist=[];
var blocksize=0;
console.log(arr);
for(var a in arr){
var app = arr[a];
if(app.width=='single'){
console.log(app.name);
partlist.push(app);
blocksize++;
}
if(app.width=='double' && blocksize=4){
applist.push(partlist);
partlist=[app];
blocksize=2;
}
if(blocksize==size || a==arr.length-1){
applist.push(partlist);
partlist=[];
blocksize=0;
}
}
console.log(applist)
return applist;
};
return part;
});
and the html with the ng-repeats are
<div ng-repeat="block in apps | filter:search | partition:6" class="app-block" >
<li ng-repeat="app in block" class="app-tile" ng-class="{double:app.width=='double'}">
<div class="name">{{app.name}}</div>
</li>
</div>
Am I using the nested repeats wrong? As I said, the number of tiles being displayed is correct, but the error is what is concerning me (it's big, ugly and red).