angular.js - How does the ng-repeat directive output the serial number of the current repeat list item in the entire list?
天蓬老师
天蓬老师 2017-05-15 16:55:44
0
2
647

The background returns an arr of variable length. The front-end uses ng-repeat='item in arr' to loop out the elements in the array. At the same time, the front-end also needs to display the serial number on the list. How can you automatically generate this serial number?

My previous solution was to use external js to get all the list items, and then add a serial number in front of each list item. It felt inappropriate, so I asked this question

天蓬老师
天蓬老师

欢迎选择我的课程,让我们一起见证您的进步~~

reply all(2)
过去多啦不再A梦

$index + 1

世界只因有你

Add $index in front of each element content

Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template