To make long story short, and quoting ionic documentation (always reference the original source ):
"A select should be used with child elements. If the child is not given a value attribute then its text will be used as the value.
If value is set on the , the selected option will be chosen based on that value."
...hence....make sure value attributes on your ionic-select and ionic-select-option reference the same javascript object.attribute in your code...basically point to the same thing..see below page level attribute value="{{ country.id }}" in both ionic-select and array level value="{{c.id}}"
ionic-select-option
Please notice that ngModel is no longer managing the page level country attribute lifecycle
<ion-item>
<ion-select *ngIf="countries.length > 0"
(ionChange)="onCountryChaged($event)"
interface="popover"
clearInput="true"
placeholder='Country (required)'
value="{{ country.id }}">
<ion-select-option lines="none"
*ngFor="let c of countries"
value="{{ c.id }}"> {{ c.label }}
</ion-select-option>
</ion-select>
</ion-item>
Inside the .ts file we can now set *country* member programmatically
Page:constructor();
this.platform.ready().then(async () => {
this.getCountries(); //load list of countries from provider
this.country = this.navDataService.getCountry();//local data store to save state between pages
}).catch(error => { });
Page:EventHandler onCountryChaged(event): void {
let id = event.detail.value;
this.country = this.countries.find( item => item.id == id ) ;
this.navDataService.setCountry(this.country);
}
this.company.form = this.forms[0]
in yourcomponent.ts
– Derward