I am trying to define custom buttons on an ion-select by passing in options in the [selectOptions] like this:
HTML:
<ion-select [(ngModel)]="selectedSkypeUser" [selectOptions]="getSelectOptions()">
<ion-option *ngFor="let user of skypeUsers" [value]="user.name">
{{user.name}}
</ion-option>
</ion-select>
TS:
private skypeUserButtons = {
title: "Skype users",
subTitle: "Select the user you want to change",
buttons: [
{
text: 'Cancel',
role: 'cancel',
handler: () => {}
},
{
text: 'Delete',
handler: () => {
this.deleteSkypeUser();
}
},
{
text: 'Add new user',
handler: () => {
this.addSkypeUser();
}
}
]
};
getSelectOptions() {
return this.skypeUserButtons;
}
The title and subTitle are showing fine, but the buttons are just the default buttons. What am I doing wrong? And how can I fix it?
Thanks!