angular 使用 bootstrap多选下拉 select multi

跟单选下拉写法有差别,直接按照单选写的话,获取不到绑定的ng-model值

<select  multiple ng-multiple="true" ng-model="ctrl.readyToSeletcedList"
             ng-options="item.name for item in ctrl.resources">
</select>

for前的内容是显示在下拉框中的内容

当我们的ng-model只想绑定对象中的id时,我们可以通过as指定当前下拉框的key。

<select  multiple ng-multiple="true" ng-model="ctrl.readyToSeletcedList"
             ng-options="item.id as item.name for item in ctrl.resources">
</select>
原文地址:https://www.cnblogs.com/perallina/p/7071416.html