Quantcast
Channel: Ionic Forum - Latest topics
Viewing all articles
Browse latest Browse all 71530

Change Ion-Select Alert Label Text

$
0
0

@katamari671 wrote:

Is there a way to change the alert label text for a ion-select instead of using the text inside the ion-option?

For example, suppose I have this array:

let opts = [
    {text: 'Key1', value: 1, abbreviation: 'K1'},
    {text: 'Key2', value: 2, abbreviation: 'K2'},
    {text: 'Key3', value: 3, abbreviation: 'K3'},
    {text: 'Key4', value: 4, abbreviation: 'K4'},
    {text: 'Key5', value: 5, abbreviation: 'K5'},
    {text: 'Key6', value: 6, abbreviation: 'K6'},
    {text: 'Key7', value: 7, abbreviation: 'K7'},
    {text: 'Key8', value: 8, abbreviation: 'K8'},
    {text: 'Key9', value: 9, abbreviation: 'K9'}
]

And this HTML

<ion-select>
    <ion-option *ngFor='let opt in options' [value]='opt'>{{opt.abbreviation}}</ion-option>
</ion-select>

This will have a select with options showing their abbreviation. When I click on the select, an alert will open with radio options with their label text being the abbreviation. In this example, is there a way to have the alert radio option labels show the text value instead of the abbreviation value?

Posts: 1

Participants: 1

Read full topic


Viewing all articles
Browse latest Browse all 71530

Trending Articles



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