Skip to main content

What does "zone.js" do in Angular?

zone.js in Angular tracks asynchronous operations (timers, HTTP requests, DOM events, and so on) and automatically tells Angular when the interface needs to be updated.

The main points:

  1. Angular does not track all asynchronous events itself, zone.js does it for Angular.
  2. Thanks to this, there is no need to manually call change detection, Angular already knows when the data has changed.
  3. It keeps the application's state synchronized with what's shown on the screen.

In simple terms, zone.js is "watching" all asynchronous code so that the interface always stays up to date.

Short Answer

Interview ready
Premium

A concise answer to help you respond confidently on this topic during an interview.