How to use labels inside loops with AngularJS

后端 未结 3 790
陌清茗
陌清茗 2021-02-02 06:01

So I\'m inside an ng-repeat like this:

  • 3条回答
    •  情深已故
      2021-02-02 06:32

      The correct solution is Gleno's.

      $id is guaranteed to be unique for every created scope, while $index changes with any change to the count of the underlining collection.

      You need to add the $index property(zero based) that is available on the scope in the repeater

    提交回复
    热议问题