[英]Angular ui-select not displaying
我想使用ui-select,但它不显示任何内容,并且在开发人员控制台中没有错误。 我已经搜索了几个小时,并且尝试了所有发现的建议,但没有任何帮助。
我使用Chrome,并且在SPA项目中包含了Bootstrap版本3.3.4和Angular版本1.4.8。 我还提供了select.min.css和select.min.js的最新版本。 我通过Visual Studio 2015中的NuGet将ui-select(版本0.19.5)添加到我的项目中。
在尝试找出问题时,我将代码简化为一个非常简单的示例。 这是我现在所拥有的(在我看来):
<div id="damageType" name="damageType" class="col-md-4">
<ui-select ng-maxlength="10">
<ui-select-choices repeat="f in ['light','hpexp']">
{{ f }}
</ui-select-choices>
</ui-select>
</div>
我试图像这样添加ng-hide无济于事:
<div id="damageType" name="damageType" class="col-md-4">
<ui-select ng-maxlength="10">
<ui-select-choices repeat="f in ['light','hpexp']" ng-hide="!$select.open">
{{ f }}
</ui-select-choices>
</ui-select>
</div>
这是页面中的外观。 应该在其中显示下拉列表的div在那里,但是高度为1。此外,如您所见,控制台中没有错误:
这可能是什么问题?
嗨,我认为您缺少两件事。
ng-model='selectedvalue'
ui-select-match
因为这是包含的必要条件 下面的代码应该工作:
<ui-select ng-model="ctrl.selected">
<ui-select-match placeholder="Enter an thing...">{{$select.selected}}</ui-select-match>
<ui-select-choices repeat="item in ['1','2']">
<span>{{item}}</span>
</ui-select-choices>
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.