Reputation: 35
I have a ng-model
called field.value
which is also from ng-repeat
. when I check the field.value
by putting inside the <span>
element. I can check the value is 17
from which I expected the drop down goes to the id
of 17
but it's doing nothing. How can I make the dropdown choose a value depending on id
bound with model.
<div ng-if="field.name=='OrderTypeId'" class="input-group inputFill">
<select class="form-control inputFill2" ng-model="field.value"
ng-options="oderType.id as oderType.name for oderType in dropdown.availableOrderTypes | orderBy:'name' track by oderType.id">
</select>
<span>{{field.value}}<span>
</div>
Upvotes: 0
Views: 25
Reputation: 48948
From the Docs:
select as
andtrack by
Be careful when using
select as
andtrack by
in the same expression.
For more information, see
Upvotes: 0