Ion-select with multiple=true not correctly initialised


#1

The ion-select is correctly initializing for a single selection, but not for multiple.
In my html template I have:

           <ion-select name="optionselect" id="optionselect" multiple="true" [(ngModel)]="customer.optionselect">
              <ion-option value="option1">Option 1</ion-option>
              <ion-option value="option2">Option 2</ion-option>
           </ion-select>

In my typescript component I have this object:

customer = {
name: ‘’,
optionselect: ‘option1,option2’,
};

When I run, none of the options is selected.

Am I doing something wrong? Thx!!


#2

Try optionselect: ['option1','option2'].


#3

OK, that’s working! Thanks a lot!! /Frank