0
我有一系列的3選擇刪除在其他領域中選擇的選項。除了這個問題這個Angular過濾器爲什麼會被應用到LIKE ID?
<label>Choice 1</label>
<select ng-model="food.fruitOne"
ng-options="fruit.id as fruit.name for fruit in fruits | filter:food.fruitTwo!=''?{id: '!' + food.fruitTwo}:{} | filter:food.fruitThree!=''? {id: '!' + food.fruitThree}:{}">
<option value=""></option>
</select>
<label>Choice 2</label>
<select ng-model="food.fruitTwo"
ng-options="fruit.id as fruit.name for fruit in fruits | filter: food.fruitOne!=''?{id: '!' + food.fruitOne}:{} | filter: food.fruitThree!=''?{id: '!' + food.fruitThree}:{}">
<option value=""></option>
</select>
<label>Choice 3</label>
<select ng-model="food.fruitThree"
ng-options="fruit.id as fruit.name for fruit in fruits | filter: food.fruitOne!=''?{id: '!' + food.fruitOne}:{} | filter: food.fruitTwo!=''?{id: '!' + food.fruitTwo}:{}">
<option value=""></option>
</select>
偉大工程;
它似乎過濾像id。因此,如果選擇1,則具有1x id的項目也會從隨後的選擇中過濾。與其他類似的ID相同 - 2 & 2x。
顯然我沒有足夠明確。少了什麼東西?
謝謝!
https://plnkr.co/edit/gzuhYYX2P1Wd0OtfLgOU?p=preview – maurycy
謝謝@maurycy,will給那個旋轉。 – RushVan
這是謝謝朋友! – RushVan