鍍金池/ 問(wèn)答/HTML5  HTML/ angularJS中使用bootstrap-select多選報(bào)錯(cuò),為什么?

angularJS中使用bootstrap-select多選報(bào)錯(cuò),為什么?

<select id="ShopSelectionCombobox"
        class="form-control _shop-combo"
        ng-options="shop.name as shop.displayName for shop in shops"
        ng-model="selectedShop"
        ng-change="selectChange({selectedShop:selectedShop})"
        ui-jq="selectpicker"
        ui-options='{ iconBase: "", tickIcon: "fa fa-check" }'
        multiple
        data-live-search="true"
        data-dropup-auto="true"
        data-none-selected-text="{{filterByShopText}}">
</select>

報(bào)錯(cuò)信息是:
TypeError: values.map is not a function

at SelectController.writeNgOptionsMultiple [as writeValue] (angular.js:29949)
at Object.ngModelCtrl.$render (angular.js:32572)
at updateOptions (angular.js:30131)
at $watchCollectionAction (angular.js:17718)
at Scope.$digest (angular.js:17855)
at Scope.$apply (angular.js:18125)
at done (angular.js:12233)
at completeRequest (angular.js:12459)
at XMLHttpRequest.requestLoaded (angular.js:12387)
回答
編輯回答
荒城

確保你的shops是數(shù)組的形式

2017年11月25日 21:58