Warning: file_get_contents(/data/phpspider/zhask/data//catemap/2/ionic-framework/2.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Angular 如何在ion select中显示从locaStorage获得的其中一个值的默认值? {{country.name}_Angular_Ionic Framework - Fatal编程技术网

Angular 如何在ion select中显示从locaStorage获得的其中一个值的默认值? {{country.name}

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}} &

我需要从页面加载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-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');