How to obtain previous item in ng-repeat?

后端 未结 4 911
陌清茗
陌清茗 2020-12-03 00:51

I have a template in which I want to generate some HTML only if the current item has some different fields from the previous item. How can I access the previous item in an

4条回答
  •  囚心锁ツ
    2020-12-03 01:15

    Why not using key from ng-repeat ? ($index seems tricky compared to key)

    My previous item is {{ data[key-1] }}, my actual item is {{ item }}

提交回复
热议问题