<select ng-model="dayOfMonth">
<option value="" label="Select day"></option>
<option ng-selected="parseInt(dayOfMonth) === parseInt(day+1)" ng-repeat="day in getTotalDays() track by $index" value="{{$index+1}}>{{$index+1 | ordinal}} of the month</option>
</select>
I have an ng-model dayOfMonth whose value i am getting as 12, but when i try to select a default value based on dayOfMonth its always selecting all the last index.
Below is my getTotalDays function which just returns an array of 28 items.
$scope.getTotalDays = function(){
return new Array(28);
}
ngOptions(the directive that was made exclusively for<select>tag)?