Get the index (counter) of an 'ng-repeat' item with AngularJS?

后端 未结 3 2000
别那么骄傲
别那么骄傲 2021-02-02 06:42

I am using AngularJS and its ng-repeat directive to display a sequence of questions. I need to number each question starting with 1. How do I display a

3条回答
  •  盖世英雄少女心
    2021-02-02 07:30

    Angularjs documentation is full of examples, you just need to take some time and explore it.

    See this example here : ngRepeat example , it's the same case.

    • {{$index + 1}} {{ question.questionText }}
      • {{answer.selector}}. {{ answer.answerText }}

提交回复
热议问题