I want to loop html select option with a number(5).
I have tried below code but not working :
<select>
<option ng-repeat="n in [] | range:5" value="{{$index+1}}">{{$index+1}}</option>
</select>
Range limits the current array. But your array doesn't have anything. ng-repeat is working for defined array. So you can define an array in your scope and use it.
html
<div ng-app ng-controller="TestController">
<select>
<option ng-repeat="n in myNumberArray" value="{{$index+1}}">{{$index+1}}</option>
</select>
</div>
controller
function TestController($scope) {
$scope.myNumberArray = new Array(5);
}