Opening a ModalController view from action-sheet button is not working

I am working on a school project and I wanted to open a modal view from the action-sheet button but I do get this error below
TypeError: Cannot read property 'addMedicationModalCtrl' of undefined but when I use ion-button out side the action-sheet, it works.

the snapshot of the sample code below

 constructor(
    private addMedicationModalCtrl: ModalController,
    private actionSheetCtrl: ActionSheetController,

  ) { }

  ngOnInit() {

  }

  addMedication() {
    console.log("add medication");
    this.addMedicationModalCtrl.create({
      component: CreateMedicationComponent
    }).then(modalEle => {
      modalEle.present();
    });
  }


  onTreatment() {
    const actionSheet = this.actionSheetCtrl.create({
      header: 'Treatment',
      buttons: [
        {
          text: 'Medication',
          role: 'medication',
          handler: this.addMedication,
        },
      ],

    })
    actionSheet.then(actionSheetEle => {
      actionSheetEle.present();
    });
  }

Hello @famousmighodaro,

Here we need to use handler as fat arrow function, Please try to improve your code like this:

onTreatment() {
    const actionSheet = this.actionSheetCtrl.create({
      header: 'Treatment',
      buttons: [
        {
          text: 'Medication',
          role: 'medication',
          **handler: () => {**
**              this.addMedication();**
**          },**
        },
      ],

    })
    actionSheet.then(actionSheetEle => {
      actionSheetEle.present();
    });
  }

HTH!