表格结构
ID Name
1 milk
2 flour
4 sugar
8 salt
16 eggs
32 butter
<select multiple ng-click="FilterIngredients" ng-model="model.ID" ng-options="items.ID as items.Name for items in model.Ingredients " required>
<option selected disabled value=""></option>
</select>
如何从选择框中选择多个选项而无需按住ctrl按钮?我想只传递其余的最高ID,如果用户先点击黄油然后再点奶,那么黄油的ID必须返回32
。
$scope.FilterIngredients = function (item) {};
答案 0 :(得分:0)
有几种方法可以做到这一点:
bower install angularjs-dropdown-multiselect
<div ng-dropdown-multiselect="" options="example1data" selected-model="example1model"></div>
$scope.example1model = [];
$scope.example1data = [ {id: 1, label: David"}, {id: 2, label: "Jhon"},{id: 3, label: "Danny"}];