angularJS中使用bootstrap-select多选报错,为什么?

<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>

报错信息是:
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)
阅读 3k
1 个回答

确保你的shops是数组的形式

撰写回答
你尚未登录,登录后可以
  • 和开发者交流问题的细节
  • 关注并接收问题和回答的更新提醒
  • 参与内容的编辑和改进,让解决方法与时俱进
推荐问题