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
$index + 1
Add $index in front of each element content