当设置search_dropdown值时,使用所选值作为索引需要设置filterText下拉列表的值。
<div class="form-group" data-ng-repeat="filter in filtersArray track by $index">
<select name="search_dropdown"
ng-model="search_dropdown[filter]"
class="form-control">
<option value="">Select Filter Field</option>
<option data-ng-repeat="t in list_fields" value="{{t.field}}">{{t.displayName}}</option>
</select>
<select name="filterText" class="form-control" ng-model="filterText[filter]">
<option value="">Select Filter Text</option>
<option data-ng-repeat="t in list['{{search_dropdown[filter]}}'] track by $index" value="{{t}}">{{t}}</option>
</select>
search_dropdown = ['name','description']
和值
list['name'] = ['A','B'] and list['description'] = ['C','D']
其中list是一个对象。
<option data-ng-repeat="t in list['{{search_dropdown[filter]}}']
track by $index" value="{{t}}">{{t}}</option>
这里如何设置filterText下拉列表的值,当在search_dropdown中选择名称时选择A,B,选择描述时选择C,D?