Popover not working

Hi All,

I have the following code, but when I invoke it, the popover does not display.

Any ideas appreciated:

ts

public popImage(image: string, text: string): void {
    this.popover = this.popoverController.create(ImagePopOverPage, {
        image: image,
        text: text
    });
    this.popover.present();
}

imagePopOverPage.ts

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

@Component({
    template: `
    <ion-content padding id="image-popover">
      <ion-list>
        <ion-row>
          <ion-col>
            <center>
            test
            </center>
          </ion-col>
        </ion-row>
      </ion-list>
    </ion-content>
  `
})
export class ImagePopOverPage {
    private image: string = null;
    private text: string = null;

    constructor(private navParams: NavParams) {
        console.log('ImagePopOverPage');
        this.image = navParams.get('image');
        this.text = navParams.get('text');
    }
}

The console.log('ImagePopOverPage'); is not even invoked.

My mistake. I was missing the following in the constructor:

popoverController: PopoverController

1 Like