Way to ng-repeat defined number of times instead of repeating over array?

前端 未结 26 3269
刺人心
刺人心 2020-11-22 14:53

Is there a way to ng-repeat a defined number of times instead of always having to iterate over an array?

For example, below I want the list item to show

26条回答
  •  醉酒成梦
    2020-11-22 15:18

    Heres an answer for angular 1.2.x

    Basically it is the same, with the slight modification of of the ng-repeat

  • here is the fiddle: http://jsfiddle.net/cHQLH/153/

    this is because angular 1.2 doesn't allow duplicate values in the directive. This means if you are trying to do the following, you will get an error.

提交回复
热议问题