@anubro wrote:
Below is the select component code:
<label class="item item-input">
<span class="input-label">Date</span>
<select ng-model="loginData.bookingdate" style=" width:100%; text-align:center;" ng-change="update()">
<option selected="selected" ng-repeat-start="item in mydate3" value="{{item.title | date:'yyyy-MM-dd' }}" ng-if="$first" Today>
{{item.title | date:'dd-MM-yyyy EEEE' }} Today
</option>
<option ng-repeat-end value="{{item.title | date:'yyyy-MM-dd' }}" ng-if="!$first">
{{item.title | date:'dd-MM-yyyy EEEE' }}
</option>
</select>
</label>and mydate3 in controller file is something like :
`$scope.mydate3 =
[
{ title: new Date().setDate(new Date().getDate()) },
{ title: new Date().setDate(new Date().getDate() + 1) },
{ title: new Date().setDate(new Date().getDate() + 2) },
{ title: new Date().setDate(new Date().getDate() + 3) },
{ title: new Date().setDate(new Date().getDate() + 4) },
{ title: new Date().setDate(new Date().getDate() + 5) },
{ title: new Date().setDate(new Date().getDate() + 6) },
{ title: new Date().setDate(new Date().getDate() + 7) }];
`
I am unable to get select first option of the select component by default though I used selected="selected", there is white empty option exists.
Posts: 1
Participants: 1