Ion-select selected conflicts with [(ngModel)]

<ion-select ngControl="format" [(ngModel)]="format"> 
    		      <ion-option value="format1" selected="true">Format 1</ion-option>
    		      <ion-option value="format2"> Format 2 </ion-option>
    		    </ion-select>

I want the form field input to default to Format 1 when the user first sees the page. In the ts file, I also set the default value to “format1”. The code works without [(ngModel)]=“format”. When I added [(ngModel)]=“format” in, the default becomes null. Seems previously in angular 1, angular purposely made it that way. Is there any changes or work arounds in Angular 2?

Thanks!

1 Like

Same problem here…

I actually got it sorted, and it is confirmed that [(ngModel)] will overwrite selected in the new beta11 release (https://github.com/driftyco/ionic/blob/master/CHANGELOG.md). In order to get the default selected value shown, make sure you initialised it the particular field variable as the corresponding value in the .ts file.