Quantcast
Channel: Ionic Forum - Latest posts
Viewing all articles
Browse latest Browse all 230925

Issue with ion-select and ion-option

$
0
0

I think i fixed it

signup.html

	<ion-item>
			<ion-icon item-start name="phone-portrait"></ion-icon>
			<ion-select item-left [(ngModel)]="account.code" name="countrycode" [selectedText]="account.code" [selectOptions]="{title:'Select Your Country'}">
				<ion-option *ngFor="let country of countries" [value]="country.code">{{country.name}} {{country.code}}</ion-option>
			</ion-select>
			<ion-input item-end type="text" [(ngModel)]="account.number" name="number"></ion-input>
	</ion-item>

we add [selectedText] to the ion-select not the ion-options. In the ion-select we dont have access to the country object, so we use account.code instead. This displays the selected ngmodel value which is the account code.


Viewing all articles
Browse latest Browse all 230925

Trending Articles



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