【发布时间】:2016-12-23 18:46:41
【问题描述】:
我有一个包含四个选项的下拉菜单。我选择第一个选项为“John (1)”并添加一行。现在下一个下拉菜单应该只显示下拉菜单中的三个选项,即,它应该排除上一个下拉选择值的值,即“John (1)”。在下一个添加行上,它应该排除前两个选定的下拉值。这是否可以实现。先感谢您。下面是小提琴。
<div ng-app ng-controller="LoginController">
<table class="table table-striped">
<thead>
<tr>
<th>Description</th>
</tr>
</thead>
<tbody>
<tr ng-repeat="mapping in viewTemplateRow">
<td>
<select class="form-dropdown" id="templateId" ng-model="mapping.id">
<option value="">Please Select...</option>
<option ng-repeat="option in viewTemplateData" value="{{option.id}}" ng-selected="{{option.id == mapping.id}}" ng-model="viewTemplateData">{{option.name}} ( {{option.id}} )</option>
</select>
</td>
</tr>
</tbody>
</table>
<button type="button" class="button button-compact" ng-click="addRow();">Add New Row</button>
</div>
【问题讨论】:
标签: javascript angularjs