Resolved - None ngFor ion-option set default value

hi, just started ionic and was wondering how to set the default value on an ion-option. I’ve searched some questions here at the forum but what i’ve found have been ion-options using ngFors but im using a given set of options

<ion-item>
      <ion-label>Packaging</ion-label>
        <ion-select [(ngModel)]="packaging">
          <ion-option selected value="Plastic">Plastic</ion-option>
          <ion-option value="Box">Boxed</ion-option>
        </ion-select>
    </ion-item>

can anyone help me with this?
using ionic version 3.19.1

You just need to initialize packaging with the value that you want to be selected:

ngOnInit () {
this.packaging = ‘Box’;
}

this worked wonders!!
thanks a lot for this man

1 Like

No problems dude, please mark the post as solved by my post :stuck_out_tongue_winking_eye:

sorry man i just pressed solve for this now, i immediately went back to coding then slept hahaha

1 Like