Angular 如何在ion select中显示从locaStorage获得的其中一个值的默认值? {{country.name}
我需要从页面加载HTML时从本地存储获取的值中设置默认值Angular 如何在ion select中显示从locaStorage获得的其中一个值的默认值? {{country.name},angular,ionic-framework,Angular,Ionic Framework,我需要从页面加载HTML时从本地存储获取的值中设置默认值 <ion-select (ionChange)="onCountryChange($event)" [value]="country" formControlName ="country" name="country"> <ion-select-option [value]="country.name" *ngFor="let country of countryList"> {{country.name}} &
<ion-select (ionChange)="onCountryChange($event)" [value]="country" formControlName ="country" name="country">
<ion-select-option [value]="country.name" *ngFor="let country of countryList">
{{country.name}}
</ion-select-option>
</ion-select>
共享从LS获取数据的时间和初始化反应表单的位置的代码
<ion-select (ionChange)="onCountryChange($event)" [value]="selectedType" formControlName ="country" name="country">
<ion-select-option [value]="country.name" *ngFor="let country of countryList">
{{country.name}}
</ion-select-option>
</ion-select>
this.selectedType = countryList.find(c => c.value == 'condition');