question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Not able to import HTMLIonModalElement - ionic v4

See original GitHub issue

I am using vs code.

Trying to import HTMLIonModalElement, but found out it’s not been exported.

I am trying to return modal from invoked function but not able to set return type.

async addTodoDialog(todoItem?: Todo): Promise<HTMLIonModalElement> {
    const modal = await this.modalController.create({
      component: AddTodoComponent,
      componentProps: { todoItem }
    });
    await modal.present();
    return modal;
  }

Getting error

ReferenceError: HTMLIonModalElement is not defined

I already found this issue opened earlier, but can we have any alternate solution to this. [https://github.com/ionic-team/ionic/issues/14784](Link here #14784)

@peterpeterparker Do you have any resolution to this ?

Regards

Issue Analytics

  • State:closed
  • Created 5 years ago
  • Comments:6 (2 by maintainers)

github_iconTop GitHub Comments

2reactions
peterpeterparkercommented, Mar 17, 2019

Don’t import it 😉

async addTodoDialog(todoItem?: Todo) {
    const modal = await this.modalController.create({
      component: AddTodoComponent,
      componentProps: todoItem
    });
    await modal.present();
  }
1reaction
peterpeterparkercommented, Mar 17, 2019

You should open a question on the Ionic forum for support request

Read more comments on GitHub >

github_iconTop Results From Across the Web

Not able to import HTMLIonModalElement - ionic v4 #17809
I am using vs code. Trying to import HTMLIonModalElement, but found out it's not been exported. I am trying to return modal from...
Read more >
How to declare and use modals in Ionic v4 | by David Dal Busco
First thing we have to do in order to use our modal is importing it in the module of the page or component...
Read more >
ion-modal: Ionic Mobile App Custom Modal API Component
ion -modal is a dialog that appears on top of mobile app content, and must be dismissed before interaction resumes. Learn more about...
Read more >
Property 'onDidDismiss' does not exist on type ionic 4 and ...
I have followed this code to create my modal property. async openModal() { const modal: HTMLIonModalElement = await this ...
Read more >
How To Declare And Use Ionic Modals With Stencil
The trick is to pass the modal tag name as value of the component variable. import {Component, h} from '@stencil/core'; import {modalController} ...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found