0
我正在使用ui选择角。我需要一个选择空值的选项。谷歌搜索,但无法找到适合的解决方案。ui选择角需要一个空值的可选选项
<script src="https://ajax.googleapis.com/ajax/libs/angularjs/1.2.23/angular.min.js"></script>
<ui-select allow-clear ng-model="hotelsCtrl.companySelectedInsert" theme="bootstrap">
<ui-select-match placeholder="Select or search company in the list...">{{$select.selected.name}}</ui-select-match>
<ui-select-choices repeat="company in hotelsCtrl.companies | filter: $select.search">
<span ng-bind-html="company.name | highlight: $select.search"></span>
</ui-select-choices>
</ui-select>
公司= [{name:'none',value:null}]; 我将此添加到我的酒店按钮。但仍然不起作用。 – Senpuki
向我展示来自'hotelsCtrl.companies'数组的一个样本元素 – Miqe
该数组为空。我从数据库中获得我的公司。 – Senpuki