我试图预选我的多选选项。为了明确我的情况,我做了一个JSFiddle。AngularJS:多选择预选选项
<select ng-model="properties" id="props" multiple
ng-options="option.name group by option.category for option in options"></select>
不幸的是,我受到对象的接收方式的约束,所以我想我需要ng-options属性。
有没有人有一个想法我怎么能得到'美国队长'和'博士厄运'选择负载?
你也可以做$ scope.properties = [“4”,“9”]并使用option.id作为option.name –