I have $scope.items = [item1, item2, etc...] and ng-repeat="item in items" in html.
When I change $scope.items = [anotherItem1, anotherItem2, etc...], there is a delay in rendering.
The result is that I see the first array, than I see the 2 arrays combined (for 300ms), then it renders and shows only the second array.
Video to understand the problem perfectly (contains preview and code): drive.google.com/file/d/0B_2AM8ZhXhE9a2VjRmlycWJO…
EDIT: The ng-class is delaying too the render...
Performance can be improved by using ng-repeat's "track by $index". Angular is watching too many items on the DOM so you will see slow rendering. The "track by" speeds it up so you won't get combined arrays.
Matan Yedayev
Full stack developer
I have found great solution!
2 steps:
ng-if="items.length"(to theng-repeatcontainer)in controller:
function onStateChange() { $scope.items = []; $timeout(function() { $scope.items = getItems(); }); }Preview video: drive.google.com/file/d/0B_2AM8ZhXhE9c2IyZFg2aXhs…