我尝试使用ui-选择代替选择角应用程序。我的问题是ui选择是不可见的。
这是使用select的工作代码:
<select class = "form-control"
ng-model = "vm.user">
<option ng:repeat = "u in vm.users"
value = "{{u.id}}">
{{u.login}}
</option>
</select>不使用ui-select的代码
<ui-select ng-model = "vm.user"
style = "width: 300px; height: 50px">
<ui-select-choices repeat = "u in vm.users">
<div ng-bind-html = "u.login"></div>
</ui-select-choices>
</ui-select>index.html
<!-- UI-Select -->
<link href = "content/select.min.css"
rel = "stylesheet" />
<!-- Angular -->
<script src = "scripts/angular.min.js"></script>
<!-- UI-Select -->
<script src="scripts/select.min.js"></script>知道有什么不对吗?
发布于 2015-12-28 00:11:30
您还必须使用ui-select-match指令。否则将不会显示。
<ui-select-match placeholder="do select..">
{{$select.selected.login}}
</ui-select-match>发布于 2016-10-27 09:28:23
以下是你可以做的事情:
angular.module('something', ['ui.select'])<ui-select ng-model="vm.user" style="width: 300px; height: 50px;">
<ui-select-match placeholder="Select user...">
{{$select.selected.name}}
</ui-select-match>
<ui-select-choices repeat="user in vm.users | filter: $select.search">
<div ng-bind-html="user.name | highlight: $select.search"></div>
</ui-select-choices>
</ui-select>https://stackoverflow.com/questions/33844895
复制相似问题