gpt4 book ai didi

javascript - 绑定(bind)输入并选择一个 ng-model

转载 作者:行者123 更新时间:2023-12-03 11:26:49 26 4
gpt4 key购买 nike

绑定(bind)模型同时输入和选择时存在问题。从下拉列表中选择模型时,输入值会发生变化。但如果输入的输入值等于列表中的某些值,下拉列表不会更改。

Example on Plunker

<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)

最佳答案

改变<input type="text"><input type="number">已修复。

http://plnkr.co/edit/FQqVGZz51SCJunWPZwfd?p=preview

关于javascript - 绑定(bind)输入并选择一个 ng-model,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/26884595/

26 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com