What is
**NgZone**
service? How Angular is notified about the changes?-
Zone.js
is one of the Angular dependencies which provide a mechanism, called zones, for encapsulating and intercepting asynchronous activities in the browser (e.g.setTimeout
,setInterval
,promises
).
-
These zones are execution contexts that allow Angular to track the start and completion of asynchronous activities and perform tasks as required (e.g. change detection). Zone.js provides a global zone that can be forked and extended to further encapsulate/isolate asynchronous behaviour, which Angular does so in its
NgZone
service, by creating a fork and extending it with its own behaviours.