This repository has been archived by the owner on Feb 26, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 407
ResizeObserver issue #1011
Comments
@scaljeri, sure, I will make a patch for this. |
For the mean time, is there an easy way to run the code inside the callback within a zone? |
for now, you can do this to run the callback in constructor(private ngZone: NgZone) {}
const observer = new window.ResizeObserver(this.ngZone.run((entries) => {
this.observedWidth = entries[0].contentRect.width; // Outside a zone??!!
}));
observer.observe(this.resizable.nativeElement); |
thanks a lot! |
JiaLiPassion
added a commit
to JiaLiPassion/zone.js
that referenced
this issue
Feb 3, 2018
JiaLiPassion
added a commit
to JiaLiPassion/zone.js
that referenced
this issue
Feb 3, 2018
JiaLiPassion
added a commit
to JiaLiPassion/zone.js
that referenced
this issue
Feb 9, 2018
JiaLiPassion
added a commit
to JiaLiPassion/zone.js
that referenced
this issue
Feb 10, 2018
JiaLiPassion
added a commit
to JiaLiPassion/zone.js
that referenced
this issue
Feb 10, 2018
JiaLiPassion
added a commit
to JiaLiPassion/zone.js
that referenced
this issue
Feb 10, 2018
mhevery
pushed a commit
that referenced
this issue
Feb 12, 2018
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
I'm using ResizeObserver for which I use a polyfill because its browser support is limited. Now, recently, chrome 64 natively supports this API with the result that changes trigged by ResizeObserver don't trigger
changedetection
in my angular app.stackblitz demo
The expected behaviour can be seen in firefox/safari and chrome 63 of course.
Now I don't know that much about Zone.js. but I would expect Zone.js to take care of this?
For more details:
stackoverflow question
The text was updated successfully, but these errors were encountered: