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

前端 未结 26 3571
刺人心
刺人心 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:23

    I ran into the same issue. I came across this thread, but didn't like the methods they had here. My solution was using underscore.js, which we had already installed. It's as simple as this:

    • {{n}}

    This will do exactly what you're looking for.

提交回复
热议问题