i want to change the text of ion-select option from the previous one to a new one when I enter a text though alert controller.
here is my code
html file
<ion-select (ionChange)="ForNewRoutine(newr)" [(ngModel)]="Routine">
<ion-option value="Breakfast">Breakfast</ion-option>
<ion-option value="Lunch">Lunch</ion-option>
<ion-option value="Dinner">Dinner</ion-option>
<ion-option (ion-Select)="newroutine" value="new">Create a new one</ion-option>
</ion-select>
ts file
ForNewRoutine(newr) {
if (this.Routine=='new') {
let routine = this.altertCtrl.create({
title: "Enter your Routine",
inputs: [
{
type: "text",
name: "routine",
}]
,
buttons: [{
text: "Cancel"
}, {
text: "Add Routine",
handler: (inputData) => {
let addtext;
addtext = inputData.routine;
this.Routine[addtext];
///this.Routine.push(addtext);/* for pop up adding message*/
routine.onDidDismiss(() => {
let routineToast = this.toastCtrl.create({
message: "new user is added successfully",
duration: 2000
});
routineToast.present();
});
}
}]
});
routine.present();
} else {
console.log('value not replace');
}
}
in last image they didint show new routine , i want show that new routine in that last image when i entered it .
Thank you.