Angularjs ngOptions-在表达式中使用track by时,筛选器不起作用
请看这本书: 为什么筛选器不使用在表达式中具有“跟踪依据”的ng选项,而使用“选择为”时该选项也不起作用Angularjs ngOptions-在表达式中使用track by时,筛选器不起作用,angularjs,Angularjs,请看这本书: 为什么筛选器不使用在表达式中具有“跟踪依据”的ng选项,而使用“选择为”时该选项也不起作用 <span> state selector : </span> <select ng-model="filter.stateID" ng-options="item.stateID as item.state for item in st_option"></select> <br> <span>count
<span> state selector : </span>
<select ng-model="filter.stateID"
ng-options="item.stateID as item.state for item in st_option"></select>
<br>
<span>county selector: select as</span>
<select
ng-model="filter.countyID"
ng-options="item.countyID as item.county for item in co_option | filter:{ co_state_id : filter.stateID }">
</select>
<br>
<span>county selector: track by</span>
<select
ng-model="filter.countyID2"
ng-options="item.county for item in co_option track by item.countyID | filter:{ co_state_id : filter.stateID }">
</select>
状态选择器:
县选择器:选择为
县选择器:跟踪
更改
ng-options="item.county for item in co_option track by item.countyID | filter:{ co_state_id : filter.stateID }">
到
更改为:
<span>county selector: track by</span>
<select ng-model="filter.countyID2"
ng-options="item.county for item in co_option | filter:{ co_state_id : filter.stateID } track by item.countyID">
</select>
县选择器:跟踪方式
<span>county selector: track by</span>
<select ng-model="filter.countyID2"
ng-options="item.county for item in co_option | filter:{ co_state_id : filter.stateID } track by item.countyID">
</select>