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