@Doomkin wrote:
Hello,
I have the following html:
<ion-item> <ion-label position="floating">Choose one...</ion-label> <ion-select cancel-text="Cancel" name="selectedPest" [(ngModel)]="selectedPest" (ionChange)="pestSelected()"> <ion-select-option *ngFor="let selectable of selectablePests" value="{{selectable.id}}">{{selectable.name}}</ion-select-option> </ion-select> </ion-item>
and the following ts
pestSelected() { this.selectablePests = this.selectablePests.filter(pest => { return +this.selectedPest !== pest.id; }); }
The issue is that the options are not refreshed when I remove items from the array.
If I put a console.log after the filter, the array has the correct items, but the options are still there even if I removed them.If I do
pestSelected() { this.selectablePests.push({id: 999, name: 'test'}); }
The new item is present in the select options.
Am I missing something?
Thanks!
Posts: 1
Participants: 1