Currently, I am working on creating a Date of Birth picker Dropdown using ng-repeat. One issue that I'm encountering is the need to append the options as DD for Day, MM for Month, and YYYY for Year in the dropdown menu as the initial elements. Here is the code snippet that I've been utilizing for generating the dropdown:
<div ng-app="myapp">
<div ng-controller="ctrlParent">
<select class="day" id="DateOfBirth_Day" name="DateOfBirthDay" required ng-model="dobday">
<option ng-repeat="i in getNumber(days) track by $index" value="{{$index+1}}">{{$index+1}}</option>
</select>
</div>
</div>
The controller code included is as follows:
var app = angular.module('myapp',[]);
app.controller('ctrlParent',function($scope){
$scope.days= 31;
$scope.getNumber = function(num) {
return new Array(num);
}
});