StackBlitz example: https://stackblitz.com/edit/components-issue-h6h2vv
Steps to reproduce:
The lifecycle of the dialog should be triggered and the dialog should display the information
The only thing from the dialog class called is the constructor, everything else is not called and the dialog cannot be closed
When I tried it out on my environment, I found out that any resize event (maybe other events too) trigger the lifecycle of the component, it updates and works fine.
On StackBlitz though the events are not triggered in any case, it just renders the app totally unresponsive
So my current solution to this is - dispatching resize event right after opening the dialog, which makes it work fine, but I have no idea why is it failing to trigger the onInit etc. by itself.
Also no .onOpen() or .onOpened() subscriptions emit any data before resize event
It sounds like the dialog is opened outside of the NgZone. Have you tried calling dialog.open from inside of NgZone.run?
@crisbeto NgZone.run seems to fix it. So I guess that solves the issue
https://stackblitz.com/edit/components-issue-2yurh6
Why is it run out of the NgZone like that though?
This issue has been automatically locked due to inactivity.
Please file a new issue if you are encountering a similar or related problem.
Read more about our automatic conversation locking policy.
_This action has been performed automatically by a bot._
Most helpful comment
It sounds like the dialog is opened outside of the
NgZone. Have you tried callingdialog.openfrom inside ofNgZone.run?