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
This is only a slight variation on the accepted answer, but you don't really need to create a new function. Only to import 'Array' in the scope:
-
{{$index+1}}
var app = angular.module('myapp',[]);
app.controller('ctrlParent',function($scope){
$scope.myNumber = 5;
$scope.counter = Array;
});
See this fiddle for a live example.