Closed butterandfly closed 10 years ago
首先建立一个方法生成所需长度的数组:
$scope.range = function(n) { return new Array(n); };
然后在html中:
<div ng-repeat="a in range(5) track by $index">{{$index + 1}}</div>
具体见:http://stackoverflow.com/questions/16824853/way-to-ng-repeat-defined-number-of-times-instead-of-repeating-over-array
首先建立一个方法生成所需长度的数组:
然后在html中:
具体见:http://stackoverflow.com/questions/16824853/way-to-ng-repeat-defined-number-of-times-instead-of-repeating-over-array