This is my html code
<ion-item class="input-item item-has-value">
<ion-label position="floating">Tipo Trabajo</ion-label>
<ion-select formControlName="idTipoTrabajo" cancelText="Cancelar" okText="OK">
<ng-container *ngFor="let subitem of tipoTrabajoList">
<ng-container *ngIf="subitem.id == item.idTipoTrabajo">
<ion-select-option [value]="subitem.id">{{ subitem.nombre }}</ion-select-option>
</ng-container>
</ng-container>
</ion-select>
</ion-item>
and this charge the page in your page.ts
onInit(){
this.generalForm = new FormGroup({
idJobType: new FormControl([this.item.JobType], Validators.compose([
Validators.required;
});
}
When you change pages, a selected value does not return to the item. How can I do when loading the page, can I show the “item” of value “by default”?
The result is already compiled in this way.
@angular/core = 7.2.15
@ionic-native/core = 5.15.0
@ionic/angular = 4.11.0
@angular/cli = 7.3.9