Quantcast
Channel: Ionic Framework - Ionic Forum
Viewing all articles
Browse latest Browse all 49083

Ion-select value doesn't change on data change

$
0
0

Hello, I have following code:

<ion-select placeholder="Auswählen" value="rundenzahl" okText="Okay" cancelText="Abbrechen" [(ngModel)]="rundenzahl">
      <ion-select-option value="3">3</ion-select-option>
      <ion-select-option value="4">4</ion-select-option>
      <ion-select-option value="5">5</ion-select-option>
      <ion-select-option value="6">6</ion-select-option>
    </ion-select>
this.rundenzahlSub = this.rundenzahlService.rundenzahl$.subscribe(res => {
      console.log((res));
      
      if(res) {
        this.rundenzahl = res;
      } else {
        this.rundenzahl = 3;
      }
    });

Now there is following problem, first subscribed to rundenzahl$ the value is null because its not loaded from the storage yet. Just then it changes to lets say 3 but instead that 3 is the value selectet in ion-select, it’s still “auswählen”. How can I fix that?

2 posts - 2 participants

Read full topic


Viewing all articles
Browse latest Browse all 49083

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>