Dynamic Custom Component - Alert Overlay - NavController getActive Error


Adding a component dynamically using createComponent similar to:

I have a button in my component which should throw up an alert, so this should not involve the lifetime cycle:
let alert = this.alertController.create({
title: ‘Profile Edit’,
subTitle: ‘Show Edit Profile Overlay’,
buttons: [‘OK’]

am getting an error of:
EXCEPTION: TypeError: activeNav.getActive is not a function

I’ve tried adding IONIC_DIRECTIVES to my dynamic component directives. I am injecting the NavController and AlertController into the constructor.

I just feel like I’m missing something simple, maybe not though.

Do i need to insert my component into the navcontroller somehow after it’s been created? Is there a simple way to do that w/o pushing it on to the stack with default transitions? This component isn’t really a page, so to speak, more of an overlay, similar to a modal but a bit more complex.


Which version of Ionic 2 are you using? Beta11 introduced an issue with overlays that might the source of your troubles,

Hi Chris,

Thank you, I completely forgot to include my version. I am currently using Beta11.
Ionic Framework Version: 2.0.0-beta.11
Ionic CLI Version: 2.0.0-beta.35
Ionic App Lib Version: 2.0.0-beta.19