Zones and Change Detection

Let’s see how zones help with running change detection.

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. Something like this wouldn’t work:

Get hands-on with 1200+ tech skills courses.