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

Ion-select don´t selected default value when charge the page

$
0
0

@jgmartinezm wrote:

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.

Posts: 1

Participants: 1

Read full topic


Viewing all articles
Browse latest Browse all 70765

Trending Articles



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