Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Angular ng-repeat animation on delete

I am trying to create an add\remove animation in an ng-repeat (with css transitions). For some reason the fade out effect always happens at the bottom of the list and not on the item you choose to delete (for example try deleting the first item , the effect shows at the bottom) . Here's a plunkr http://plnkr.co/edit/XdGHKhf5z5BQMaYk1Naz?p=preview

Any thoughts ?

like image 254
Joel Blum Avatar asked Feb 12 '14 10:02

Joel Blum


2 Answers

If you remove

track by $index

, then it should be all right. just:

<div ng-repeat="item in items" class="repeat-item">
like image 108
licancabur Avatar answered Oct 27 '22 19:10

licancabur


Use a simple ng-repeat: "item in items" in this way works fine.

Check this plunker

like image 3
Atropo Avatar answered Oct 27 '22 20:10

Atropo