This took me too frikkin long to figure out, so I’m guessing other people might benefit from a writeup. I wanted to migrate a simple popover with a “close” button on the popover message. With ViewController it only required one line. Here’s the cleanest way I’ve found to do this, now that ViewController is gone.
Define the popover. When you do, pass the PopoverController itself as a parameter.
Note: using async/await instead is fine. I use Promises because they provide more granular control, but it doesn’t matter for this example. The important point here is I am passing this.pop.
I don’t understand your post yet, sorry. I need the ability to close visible inside the popover message page, so clicking a CLOSE button will close the popover message.
Thanks this helps me enormously. I want all my popovers dismiss themselves after 5 seconds, so I’ve added this in the constructor, using the same passed parameter instead of the old view controller.
constructor(navParams: NavParams) {
this.pop = navParams.get('popoverController');
{// set it to dismiss automatically after 5000ms
setTimeout(() => {
this.pop.dismiss();
}, 5000);
};
}
constructor(private popoverController: PopoverController) {
{// set it to dismiss automatically after 5000ms
setTimeout(() => {
this.popoverController.dismiss();
}, 5000);
};
}