Ionic 4 Modal Events


Can anyone tell me how to listen to modal events from within the modal component in Ionic 4?
I’m trying to listen on the “ionModalDidPresent” event so I can update the size of an internal element based on the size of the modal.

I’ve tried various things:

  • @HostListener decorator
  • modalCtrl.getTop() … addEventListener
  • as above, but using using Renderer2

Using @HostListener(‘click’) works… when I click on the modal, so I think I’m on the right track, but I cant get the ionModalDidPresent event.



1 Like

see this issue -

for now it seems like you need to use the default angular lifecycle events