1

How to define the default selected options in the select box. I'm able to display my options like this :

<select ng-model="selectedOptionId">
  <option value="">Select Option</option>
  <option ng-repeat="o in options" value="{{o.id}}">
    {{o.name}}
  </option>
</select>

But I am not able to define the default selected value

Günter Zöchbauer
  • 623,577
  • 216
  • 2,003
  • 1,567
bwnyasse
  • 591
  • 1
  • 10
  • 15

1 Answers1

1

You can set it in your component's Dart file, since selectedOptionId is your model.

selectedOptionId = 3 //assuming o.id = 3 is your default
Liew Jun Tung
  • 239
  • 1
  • 11