-1
我想過濾一個數組的ng選項。舉例:按數組篩選Angular JS ng選項
<select
ng-model="currentItem.Community.white_label_id"
ng-options="whitelabel.WhiteLabel.id as whitelabel.WhiteLabel.name for whitelabel in whitelabels | filter:whitelabel.WhiteLabel.id in currentWhiteLabel.affiliatedids"
>
currentWhiteLabel.affiliatedids看起來像[73,71]
我怎樣才能做到這一點?
你能夠分享一些示例數據嗎? – Ankh
whitelabels是一個數組,例如{「WhiteLabel」:{「id」:28,「name」:「abd」,「code」:「abc」,「type」:「collectivity」,「active」:true,嵌入 「:假的,」 子域 「:」」, 「網站」: 「http://dqsfsdf.com」, 「help_website」:空, 「email_auto」: 「[email protected]」}}。 Ng選項很好,但是我不能用數組來過濾它們 – Cby