I am facing a minor issue where I want the first element in my select dropdown to be displayed properly rather than just a blank space.
Below is the code snippet I am currently working with:
<select style="border-radius: 4px;" class="form-control" ng-model="select" ng-init="somethingHere = option[1]" id="sel1">
<option ng-repeat="option in dateHeureAdd track by option.value" value="{{option.value}}">{{option.heure}}</option>
</select>
In the above code, I have defined an array called "dateHeureAdd" which contains time values for selection. However, the initial display does not show any default value or placeholder at the beginning of the dropdown list.
$scope.dateHeureAdd = [
{value: '8', heure: '08:00'},
{value: '9', heure: '09:00'},
{value: '10', heure: '10:00'},
{value: '11', heure: '11:00'},
{value: '12', heure: '12:00'},
{value: '13', heure: '13:00'},
{value: '14', heure: '14:00'},
{value: '15', heure: '15:00'},
{value: '16', heure: '16:00'},
{value: '17', heure: '17:00'}
]
If you would like to view the functionality, please visit the following Plunker link:
http://plnkr.co/edit/aDUGvrvJjszq07Sjh0TI?p=preview
Your assistance with this matter is greatly appreciated. Thank you!