Quantcast
Channel: Ionic Framework - Ionic Forum
Viewing all articles
Browse latest Browse all 49167

Ion-select selected conflicts with [(ngModel)]

$
0
0

@sclrax wrote:

<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!

Posts: 1

Participants: 1

Read full topic


Viewing all articles
Browse latest Browse all 49167

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>