gpt4 book ai didi

javascript - 从下拉列表中的数据库中获取值

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

这是我的代码:

<ui-select ng-model="apptDetails.profile" name="profile" theme="bootstrap" ng-required="true">
<ui-select-match placeholder="Select Profile" >{{$select.selected.Profile_name}}
</ui-select-match>
<ui-select-choices
repeat="profile.Profile_id as profile in profileList | filter: $select.search">
<span ng-bind-html="profile.Profile_name | highlight: $select.search" ></span>
</ui-select-choices>
</ui-select>

我需要从数据库中获取值,并且它已经显示在下拉列表中,我在 ng-model 中获取值,但无法在下拉列表中设置它(不在选项中),但是如果我发送发布请求,它就可以工作。

例如:如果特定用户的数据库中的配置文件为 abc,它将显示在预先选择的下拉列表中。当我以表单形式获取该用户的信息时,所有文本字段都会从模型中获取数据,但无法在下拉列表中显示。

最佳答案

您可能做错了什么...当我在 plunker 上创建一个演示时,它工作正常。也许它可以帮助你...

https://plnkr.co/edit/43ToW4?p=preview

关于javascript - 从下拉列表中的数据库中获取值,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/36004403/

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