Ion-Select - Choosing a default value

Hi, I have been trying to figure out a way to add a default value for my . I have an array with a js interface.

<ion-select 
              interface = 'alert'
              class="t-select"
              placeholder = "Select your item"
              [(ngModel)]="selectedItem">
          <ion-select-option *ngFor="let item of itemArr; let i = index" value="{{item.id}}" class="t-option" >
            {{ item.token  + ' <' + item.id.substring(0, 12) + '>'  }} 
          </ion-select-option>
        </ion-select>
  1. I have tried adding [value]=“selectedItem()” which returns the item I want.
  2. I tried the compareFn.
  3. I tried the directory [ngValue] in .

All I want is for my to choose the first item in the itemArr if nothing is passed to it.

And I also am choosing the item from another page, and then adding a slider on it so that I can choose an option and pass it to my other page using params. isn’t defaulting to that id either…

Any help would be appreciated!

Assign to selectedItem.

Hi! I finally got it working… yes I assigned to selectedItem and it worked… thank you

Please, could you tell us how to use “selectedItem”? I have Ionic v6.2
I couldn’t find selectedItem