Search⌘ K

Zones and Change Detection

Explore how Angular leverages zones to wrap asynchronous operations, allowing efficient tracking of event execution and triggering precise change detection cycles. This lesson teaches you how Angular manages state and updates the UI by running change detection after zone execution, helping you optimize performance and avoid unnecessary checks.

Zones

Zones are a new concept to JavaScript, but they were a core language feature in Dart, a language Google created to replace JavaScript. Dart never gained traction, but zones made their way over to the JavaScript ecosystem to be a foundational part of Angular.

In short, zones are a way to wrap asynchronous code into a single context.

Let’s say you wanted to figure out how long an AJAX call took with regard to code execution time on the frontend. ...