【发布时间】:2014-11-12 10:24:37
【问题描述】:
绑定模型同时输入和选择有问题。当从下拉列表中选择模型时,输入值会发生变化。但如果输入的输入值等于列表的某些值,则下拉菜单不会改变。
<select
ng-model="Choice.SelectedOption"
ng-options="choice.ID as choice.Name for choice in Choice.Options">
</select>
{{Choice.SelectedOption.ID}}
input model <input type="text" ng-model="Choice.SelectedOption">
input value {{ Choice.SelectedOption }}
从下拉列表中更改模型,然后尝试将模型从输入更改为 1,2 或 3(它是用户 ID)
【问题讨论】:
标签: javascript angularjs angular-ngmodel