I have a loop that executes ten times:
ng-repeat="y in [1,2,3,4,5,6,7,8,9,10]"
Can you do it in a nicer way?
I have a loop that executes ten times:
ng-repeat="y in [1,2,3,4,5,6,7,8,9,10]"
Can you do it in a nicer way?
Yes you can try this:
ng-repeat="i in getNumber(number)"
In your controller:
$scope.number = 5;
$scope.getNumber = function(num) {
return new Array(num);
}
This will allow you the freedom to pass in any range.