is it possible to add icon to ion-option in ion-select? something like
<ion-select name="type">
<ion-option value="bar"><ion-icon name="stats"></ion-icon>Bar</ion-option>
<ion-option value="pie"><ion-icon name="pie"></ion-icon>Pie</ion-option>
</ion-select>
Solution. It is not possible to add images in ion-select-option but you can achieve the same thing by your own by : create a page and make normal ion-list with a ngfor and inside each item put an image and before it a radio button for single choice or checkbox for multichoice.
A select should be used with child <ion-select-option> elements. If the child option is not given a value attribute then its text will be used as the value. If value is set on the <ion-select> , the selected option will be chosen based on that value.
place will be the selected item when the ionChange event is triggered. Use (ngModelChange) instead of (click) event. whenever the model value changed the ngModelChange will automatically call the relative function.
hey you can try this ...
this worked for me .. Check out this site : https://www.alt-codes.net/star_alt_code.php
i used this code : ✰
so my code looks like this :
<ion-item>
<ion-label>Member's Overall Rating</ion-label>
<ion-select [(ngModel)]="newreport.memberstatus">
<ion-option value="✰">✰</ion-option>
<ion-option value="✰✰">✰✰</ion-option>
<ion-option value="✰✰✰">✰✰✰</ion-option>
<ion-option value="✰✰✰✰">✰✰✰✰</ion-option>
<ion-option value="✰✰✰✰✰">✰✰✰✰✰</ion-option>
</ion-select>
</ion-item>
the result is this (screenshot on my phone cause im testing on my phone) :
screenshot of what the results would be like
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With