How to call a parent method


#1

I am trying to call a method in the parent component from a child component but I keep getting an error that says the method is undefined.

export class RenterPage {

 public renterTabsPage: RenterTabsPage

  constructor(public viewCtrl: ViewController
      //other parameters
    ){
    //do things
}


  onDeleteRenter(key: string) {
    const actionSheet = this.actionSheetCtrl.create({
      title: 'Are you sure you want to remove this renter??',
      buttons: [
        {
          text: 'Remove',
          role: 'destructive',
          handler: () => {
            this.authService.getActiveUser().getToken()
              .then((token: string) => {
                this.renterService.deleteRenter(key, token)
                  .subscribe(
                  () => {
                    this.renterTabsPage.onDismiss();
                  },
                  error => {
                    console.log(error);
                  });

              });
          }
        },

        {
          text: 'Cancel',
          role: 'cancel'
        }
      ]

    });
    actionSheet.present();
  }

import { Component } from '@angular/core';
import { NavController, NavParams, ViewController } from 'ionic-angular';

import { RenterPage } from '../renter/renter';
import { CommentsPage } from '../comments/comments';
import { Renter } from '../../models/renter';


@Component({
  selector: 'page-renter-tabs',
  templateUrl: 'renter-tabs.html',
})
export class RenterTabsPage {

  renterPage = RenterPage;
  commentsPage = CommentsPage;
  renter: any;

  constructor(public navCtrl: NavController,
    public navParams: NavParams,
    public viewCtrl: ViewController) {

      this.renter = this.navParams.data;
  }



 public onDismiss() {
   console.log("dismissed")
    this.viewCtrl.dismiss();

  }

}