AngularJS ng-options create range

后端 未结 8 877
鱼传尺愫
鱼传尺愫 2020-11-28 09:58

I am trying to create a select element that has a list of numbers 1 to pages where pages is a variable that is the number of pages I have. What i don\'t know how to do is to

8条回答
  •  死守一世寂寞
    2020-11-28 10:14

    another approach without a for loop is this:

    controller:

     $scope.arr = [];
     $scope.arr.length = count;
    

    view binding:

     ng-options="arr.indexof(i) for i in arr"
    

提交回复
热议问题