Skip to content
This repository has been archived by the owner on Oct 7, 2020. It is now read-only.

Using MdcDialog without NgZone #2266

Open
dpraul opened this issue May 19, 2020 · 0 comments
Open

Using MdcDialog without NgZone #2266

dpraul opened this issue May 19, 2020 · 0 comments

Comments

@dpraul
Copy link

dpraul commented May 19, 2020

Hi! Firstly - you've done incredible work on this library, as well as on keeping it updated over the years. I appreciate the immense amount of effort you've put into this - thanks very much for that.

We're running into some roadblocks trying to use MdcDialog in our application. When we call dialog.open, the DOM gets added to the page, but the dialog remains hidden and afterOpened / afterClosed never emit any values. I've placed some debug statements in the dialog components and it looks like none of the lifecycle hooks run after the component constructors. We run an Angular/AngularJS hybrid app, and need to use NoopNgZone for performance reasons. When I temporarily add NgZone in, the dialog opens as-expected, but this is not a long-term solution for us.

Most times we've run into issues like this, we can get around it with more deliberate change detection, but I haven't found a way to get that to work here. I noticed that MdcDialog uses the @angular/cdk Overlay, and it seems they rely heavily on NgZone, so the answer may lie outside of this library (I did find this similar issue on the subject: angular/components#9169), but figured I'd start here in case you've faced this before.

So, that said - have you run into this before? If so, do you know of any ways to circumvent the issue and use the dialog without NgZone? Otherwise, can you recommend any approaches I can take to try to solve this?

We're running Angular 9.1.6, @angular/cdk 9.2.3, and @angular-mdc/web 5.1.1 (although I've also tried this on the 6.0.0-canary.9, with the same outcome).

Thanks again!

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant