2017-01-19 1 views
2

Bitte beachten Sie diese Plunker: https://plnkr.co/edit/U2oDUPl8w7lSlY8MkVLb?p=previewngOptions - Filter funktioniert nicht, wenn Spur von in Ausdruck verwendet wird

Warum Filter nicht mit ng-Optionen Arbeits Spur durch Expression mit und arbeiten, wenn sie als mit select?

<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>  

Antwort

2

ändern

ng-options="item.county for item in co_option track by item.countyID | filter:{ co_state_id : filter.stateID }"> 

zu

ng-options="item.county for item in co_option | filter:{ co_state_id : filter.stateID } track by item.countyID"> 
2

Änderung dieser:

<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> 
Verwandte Themen