gpt4 book ai didi

angularjs - 当包含在 angular-ui-bootstrap 模式中时,Angular ui-select 不显示选项列表

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

我遇到了 anular-ui-bootstrap modal 的问题指令。
我正在使用 Angular 的 ui-select我的应用程序中的组件作为 html 选择的替代品。这个 ui-select 在它被包含的任何页面中都可以正常工作。
但是当我试图将它包含在一个模态弹出窗口中(使用 ui-bootstrap $modal 服务)时,下拉列表不显示选项

问题转载here

angular.module('ui.bootstrap.demo').controller('ModalInstanceCtrl', function ($scope, $modalInstance, items) {
$scope.addresses = [{
"id":1,
"name": "chennai"
}, {
"id":2,
"name": "banglore"
}, {
"id":3,
"name": "madurai"
}];
});
 <div class="modal-body">
City
<ui-select ng-model="selAddress">
<ui-select-match placeholder="Choose an address">{{$select.selected.name}}</ui-select-match>
<ui-select-choices repeat="address in addresses track by $index" refresh-delay="0">
<div ng-bind-html="address.a | highlight: $select.search"></div>
</ui-select-choices>
</ui-select>

Selected: <b>{{ selAddress }}</b>
</div>


任何帮助将不胜感激。
提前致谢。

最佳答案

我用 ngDialog 遇到了这个(或类似的问题)。我通过添加 ng-hide 解决了我的问题属性如下:

<ui-select-choices repeat="..." ng-hide="!$select.open">

这解决了我遇到的问题 select-choices收到了 ng-hide在对话框中时,由于某种原因,组件内部为空属性。希望这也可以帮助您解决此问题。

关于angularjs - 当包含在 angular-ui-bootstrap 模式中时,Angular ui-select 不显示选项列表,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/29893423/

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