javascript - select tag does not support multiple -
in code use ng-options bind data select tag,also set multiple property true.
<select ng-if="exp.metadata.elementtype =='in'" multiple="" ng-multiple="true" class="form-control" ng-model="exp.value" ng-options="value.id value.title value in exp.datasource"> <option value=""> select ...</option> </select>
but in run time in browser, select tag not support multiple,also not see multiple="" or
ng-multiple="true"
when inspect select element. (f12->elements)
below minimal setup example multiple select in angular. not sure why need please select
option in multiple select, though.
angular.module('test', []).controller('test', test); function test() { var vm = this; vm.options = [ {name: 'aaa', value: '1'}, {name: 'bbb', value: '2'}, {name: 'ccc', value: '3'} ]; vm.selected = []; }
<script src="https://ajax.googleapis.com/ajax/libs/angularjs/1.2.23/angular.min.js"></script> <div ng-app='test' ng-controller='test test'> <select multiple ng-options="option.value option.name option in test.options" ng-model="test.selected"> </select> <div>{{test.selected}}</div> </div>
Comments
Post a Comment