0
我使用的是angularjs ui-select, ,正如我在默认情况下在绑定中理解的那样,我需要的是一个数组的多重下拉列表,问题是我需要具有相同的行为单选也是。angularjs ui-select绑定到一个数组
$scope.mdf.options = [{ id: 1, name: 'name1' },{ id: 2, name: 'name2' }];
<ui-select ng-model="wrap.piece.original.selections_hash[mdf.id]" close-on-select="false" title="mdf.modifier.display" ng-if="mdf.modifier.max == 1">
<ui-select-match>{{$select.selected.name}}</ui-select-match>
<ui-select-choices repeat="option.id as option in mdf.options">
<span ng-bind="option.name">
</span>
</ui-select-choices>
</ui-select>
因此,当用户例如选择NAME2我需要我的模型更新为[2]而不是2 我怎样才能做到这一点?我可以使用ui-select吗?如果不是,我可以用角度选择来做到吗?