Implementar value en input o selected con [(ngModel)]

Lo que quiero hacer es implementar el selected en un ion-select-option pero no me deja, sigue apareciendo vacio el campo esperando a que se elija una opcion. lo mismo pasa con los input cuando trato de ponerle un value no me deja, pero cuando le quito el [(ngModel)] si funciona

<ion-select placeholder=“Seleccione” [(ngModel)]=“typedoc” name=“typedoc”>

    <ion-select-option selected value="CC">Cédula de Ciudadanía</ion-select-option>

    <ion-select-option value="TI">Tarjeta de Identidad</ion-select-option>

Hi there! How are you? What is the initial value of you typedoc variable? if your initial value is null or empty, it will replace the current selected option. You can try setting the initial value like this: this.typedoc = "CC". I hope it can help you :slight_smile:

1 Like

thanks, it served me

1 Like