Angular › Zoneless Change Detection & Zone.js
What is Zone.js, and what role does it traditionally play in Angular applications?
BeginnerAnswer
Zone.js is a library that Angular has historically relied on to automatically detect when something in your application might have changed, such as after a click event, a timer, or an HTTP response, and it then triggers Angular's change detection so the screen updates to match the new data.
// polyfills.ts (traditional setup)
import 'zone.js';
// Angular patches async APIs like setTimeout,
// addEventListener, and Promises so it knows when to check for changesReal-world example A traditional Angular app updates its screen automatically after a button click handler changes a variable, without the developer manually telling Angular to refresh anything, because Zone.js detected the event and triggered change detection behind the scenes.