且构网

分享程序员开发的那些事...
且构网 - 分享程序员编程开发的那些事

当新项目添加到模型时,对所有项目进行ng-repeat更改排序顺序

更新时间:2023-12-04 10:30:58

我分叉了您的plunkr,并弄乱了它.我认为它可以按照您现在想要的方式工作.

I forked your plunkr and messed around with it. I think it works the way you want now.

http://plnkr.co/edit/1y8jE0SLuJK6XTNRBKF3?p=preview

主要解决的问题是按其索引对dom元素列表进行排序,然后将$ index添加到该元素的数据索引attr.

Mainly what fixed it was sorting the list of dom elements by their index, and to do that I added the $index to a data-index attr on the element.