Add new item in another page


#1

i want it to take the value from the when I click the add button and add a new in another page. I don’t know if what if want is clear but this my first time using ionic and desperately need .
i have a page “addmedicationPage” in this page the user adds info about a new medication, if the user choose to add the medication in the morning i want it to create a div in morning containing the info added in addmedicationPage . i’m sorry these confusing i’m just new to thihelp

  <ion-item>
    <ion-label>When to Take</ion-label>
    <ion-select [(ngModel)]="whentotake" multiple="true">
      <ion-option value="morning">Morning</ion-option>
      <ion-option value="noon">Noon</ion-option>
      <ion-option value="evening">Evening</ion-option>
      <ion-option value="night">Night</ion-option>
    </ion-select>
  </ion-item>

button :

 <button ion-button block outline large (click)="showAlert()" class="button">Add</button>

button ts :

 showAlert() {
    let alert = this.alertCtrl.create({
        title: 'Medicine has been added ',
        buttons: [
            {
                text: 'Okay Go Back to Main',
                handler: () => {
                    console.log('Okay Go Back to Medication');
                    this.navCtrl.push(medicationPage);
                }
            },
            
        ]
    });
    alert.present();

}

#2

you want to take the value when you click the add button
step:-1 this.navCtrl.push(medicationPage,{send what you want like object or some boolean values});

and in medicationPageComponet get the value using navParams
step:-2 this.navParams.get(’'what you send from parent componen");