cipchk / ngx-countdown

Simple, easy and performance countdown for angular
https://cipchk.github.io/ngx-countdown/
MIT License
192 stars 57 forks source link

Run setTimeout outside NgZone #53

Closed Totati closed 4 years ago

Totati commented 4 years ago

stackblitz demo: https://stackblitz.com/edit/ngx-countdown-do-check

Bug Report or Feature Request (mark with an x)


[x] Bug report -> please search issues before submitting
[ ] Feature request
[ ] Documentation issue or request

Current behavior

This setTimeout should be out of the ngZone, because it triggers change detection every time. You can see in my demo, that angular calls the doCheck a lot. This can be a real performance issue, when people don't use ChangeDetectionStrategy.OnPush.

Expected behavior

Change detection should be triggered only on events.