I add some items in the for loop with $timeout to see the animation. It works, but I see wrong values in the <li> items:
$scope.list = [{ id : 1},{ id : 2},{ id : 3},{ id : 4},{ id : 5},{ id : 6}];
for (var i = 0; i < $scope.myItems.length; i++) {
var x = $scope.myItems[i];
$log.log(x.id);
$timeout(function () {
$scope.list.push({ name: x.id });
}, 100 * i);
};
<ul class="item-container">
<li class="item" ng-class="animation" ng-repeat="item in list">{{item.name}}</li>
</ul>
firebug displays:
1
2
3
4
5
6
but in the <ul> tag all <li> items have 6 as a value. Why ?