This repository was archived by the owner on Apr 12, 2024. It is now read-only.
This repository was archived by the owner on Apr 12, 2024. It is now read-only.
Hidden ngRepeat elements not being removed from DOM when animations are turned on #5495
Closed
Description
If a list is hidden, but undergoes data changes, the list's scope data that was removed isn't removing the associated DOM elements.
Given an ngRepeat list inside an ngHide:
<div ng-hide="hideList">
<ul class="example-animate-container">
<li class="animate-repeat" ng-repeat="friend in friends | filter:q">
[{{$index}}] {{friend.name}} who is {{friend.age}} years old.
</li>
</ul>
</div>
to simulate the problem:
$timeout(function() {$scope.hideList = true;}) //hide the list
.then($timeout(function() {$scope.friends = [];})) //clear the list
.then($timeout(function() {$scope.hideList = false;}, 1000)); //show after animation
Removing the list's scope data while hideList == true will not remove the DOM elements of the list items. When the list is not hidden anymore, they'll show up again and not have any scope.
Here's the associated plunker with animation css:
http://plnkr.co/edit/SREOUmQ5CG8XiaosTNRU?p=preview
Metadata
Metadata
Assignees
Labels
No labels