Popup not working

Popup.alert is not working using “ionic-framework: 2.0.0-alpha.42”.

I am using “ionic-framework: 2.0.0-alpha.42” locally and “ionic@2.0.0-beta.15” globally in NPM.

Using this document as an example.

this.popup.alert({
    title: "New Friend!",
    template: "Your friend, Obi wan Kenobi, just accepted your friend request!",
    cssClass: 'my-alert'
}).then(() => {
    console.log('Alert closed');
});

That code is not working. I do not see a popup and i do not see “Alert closed” ever shown in the console. I pull in “popup” through the constructor.

private popup: Popup;
constructor(popup: Popup) {
    this.popup = popup;
}

Make sure you import Popup from the Ionic library as well, but Popup isn’t used anymore anyway. Is there a reason you’re sticking with an older version of the framework? It’s up to about Alpha 52 now and uses ‘Alert’ instead of ‘Popup’ and that NavController is now used to ‘present’ these.

Development cycle. We are dependency blocked at the moment. Next cycle we might can upgrade, but right now we can’t.

Popup is imported.

I have the call to open the popup inside of a function that is called from an HTML binding to the function using angular 2. Could that be the issue?

I figured out the issue. You need to add

<ion-overlay></ion-overlay>

to your app.html. I saw that no where in the documentation.

Yes this was required previously, then it was added automatically by the generator, and now it’s not needed at all - so probably got lost along the way somewhere there.