I am currently working on dynamically populating an ion-select
dropdown with a JSON object.
This is how my HTML component is structured:
<ion-item [hidden]="editOptions.isEditing">
<ion-note stacked color="primary">{{label}}</ion-note>
<ion-note class="inline-edit"> {{value}} </ion-note>
</ion-item>
<ion-item [hidden]="!editOptions.isEditing">
<ion-label stacked color="primary">{{label}}</ion-label>
<ion-select [(ngModel)]="value" [selectOptions]="additionalData" [required]="required" [name]="value">
<!--<ion-option>None</ion-option>-->
</ion-select>
</ion-item>
However, when I try to populate the select options in my calling code, I face the issue of not having any examples in their documentation.
additionalData = {
title: 'Pizza Toppings',
subTitle: 'Select your toppings',
mode: 'md'
};
I am looking for a way to add my options to this select without using *ngFor directly in the HTML. My preference would be to pass them like this:
additionalData = {
title: 'Pizza Toppings',
subTitle: 'Select your toppings',
mode: 'md'
options: [{id:1, description:'Pepperoni'}]
};