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

Popular posts from this blog

scala - 'wrong top statement declaration' when using slick in IntelliJ -

c# - DevExpress.Wpf.Grid.InfiniteGridSizeException was unhandled -

PySide and Qt Properties: Connecting signals from Python to QML -