title: Ionic 2: How to call parent page function from Popover component
body: <p>I have a page component with a button that opens a PopoverController. According to the Ionic Docs, popovers need another specific component for its content.</p>
  
  <p>In the main page I have a function that I need to call from the popover component, but I haven't found how to access to the "parents'" methods. I've tried with <code>@ViewChild</code> but the child is <code>undefined</code>.</p>
  
  <pre><code>import { Component, ViewChild } from '@angular/core';
  import { Content, NavController, NavParams, Platform, PopoverController, ViewController } from 'ionic-angular';
  
  // Parent page:
  @Component({
      selector: 'page-favorites',
      templateUrl: 'favorites.html'
  })
  export class FavoritesPage {
      constructor(public popoverCtrl: PopoverController) {
      }
  
      openOptions(ev?: Event) {
          let popover = this.popoverCtrl.create(FavoritesPopover);
          popover.present({ ev: ev });
      }
  
      showConfirm() {
          // This is the function I need to call from FavoritesPopover
      }
  }
  
  // Popover content:
  @Component({
    template: `
      &lt;ion-list&gt;
          &lt;button ion-item (click)="showConfirm()"&gt;Show confirm&lt;/button&gt;
      &lt;/ion-list&gt;`
  })
  export class FavoritesPopover {
      @ViewChild(FavoritesPage) favoritesPage: FavoritesPage;
  
      showConfirm() {
          this.favoritesPage.showConfirm(); // It doesn't work, favoritesPage is undefined
      }
  }
  </code></pre>
  
  <p>As you can see, I'm just starting to work with Ionic 2 and Angular, so any help would be so thankful!</p>