NgZone or zone.js: the place of decapitation?

I am learning how ngZone works in Angular . I realized that it performs the neutralization of standard asynchronous operations (for example, setTimeout).

But who makes the correction of the monkey? zone.js or Angular inside ngZone? It would be great if you could specify a specific place in the source code where this happens.

+4
source share
2 answers

Angular starts the zone inside zone.js, and zone.js provides the area with the corrected API.

You can use zone.run(...)without any changes from Angular and get all the effects of the fixed API.

See also https://github.com/angular/zone.js/

, https://github.com/angular/zone.js/blob/master/lib/common/timers.ts#L22

+2

Source: https://habr.com/ru/post/1688758/


All Articles