0
当我以这种方式将选项值绑定到模型时,它可以工作。 {{profile_filter}}
将包含{{option.label}}
:将选定的选项值绑定到ng-repeat模型中
<select ng-model="profile_filter">
<option ng-repeat="option in showCase.filters" value="{{option.label}}">
{{option.label}}
</option>
</select>
// Show Selected Option :
<div>{{profile_filter}}</div>
随着ng-repeat
我增加了额外的<select>
下拉菜单,并如预期{{profile_filter}}
现在是空的。逻辑告诉它与ng-model="profile_filter"
不具有唯一范围不再做:
<div class="filters" ng-repeat="filter in showCase.filters">
<label>{{filter.label}}
<select ng-model="profile_filter">
<option ng-repeat="option in filter.options" value="{{option.label}}">
{{option.label}}
</option>
</select>
</label>
</div>
// Empty
<div>{{profile_filter}}</div>
问:我应该采取什么方法来解决这个问题? 在此先感谢。