I have ng-options
fo select list with next format data:
data.dateList.day = [{"id":1,"value":1},{"id":2,"value":2},{"id":3,"value":3},...]
How I can select option using ng-model
when value is equal 2, for example?
I have ng-options
fo select list with next format data:
data.dateList.day = [{"id":1,"value":1},{"id":2,"value":2},{"id":3,"value":3},...]
How I can select option using ng-model
when value is equal 2, for example?
You can achieve this by using ng-selected as well.
Here is a plunker for you.
<select>
<option ng-repeat="day in days" ng-selected="{{day.id == 2}}" value="{{day.id}}">
{{day.value}}
</option>
</select>