I have a model (param) with properties:
- param.ValidValues (array of key-value pair)
- param.DefaultValues (array of value strings)
I am rendering multi-select dropdown
<select multiple ng-model="param.DefaultValues">
<option ng-repeat="item in param.ValidValues" value="{{item.Value}}" label="{{item.Key}}"
ng-selected="???">
</option>
</select>
Question: How can I (using AngularJS markup syntax) set default values in this dropdown (pre-select options that match whatever is in param.DefaultValues) ?? Use ng-selected or there is another option?
For example:
if ValidValues = ["one", "two", "three", "four"] and DefaultValues = ["two", "three"]
then "two", "three" should be pre-selected. Makes sense?
Please note, I cant modify param.ValidValues collection.