Quantcast
Channel: Ionic Forum - Latest topics
Viewing all articles
Browse latest Browse all 71530

Ionic 4 ion-select pre select value

$
0
0

@javasol wrote:

I have an ion-select that the selected value is coming from a sqlite database, meaning the value for [(ngModel)] is being populated async. In ionic v3 this would still work and would select the correct ion-option, with v4 it doesn’t. Is there any way to get this to work?

 <ion-select [(ngModel)]="selectedCodeValue" name="selectCode" multiple="false"
        (ionChange)="codeSelected()" required >
        <ion-select-option *ngFor="let code of availableCodes" value="{{code.id}}">
          {{code.id}} -  {{code.description}}
        </ion-select-option>
  </ion-select>

In the above snippet the “selectedCodeValue” gets populated async from sqlite db.

Posts: 1

Participants: 1

Read full topic


Viewing all articles
Browse latest Browse all 71530

Trending Articles



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