tezvyn:

Angular's Default Change Detection with Zone.js

Source: ojas-deshpande.comintermediate

Zone.js tells Angular to re-check your entire app whenever any async event finishes. This is Angular's default magic: a variable updates after an HTTP call, and the UI just works. The footgun? This "check everything" approach is expensive in large apps.

Zone.js acts as Angular's informant, monkey-patching all browser async APIs. When a timer, Promise, or event handler completes, it tells Angular to run change detection. This is the default strategy: an HTTP response arrives, you update a component property, and the view updates automatically. The footgun is that Angular doesn't know *what* changed, only that *something* might have, so it checks every component from the root down, causing major performance issues in large apps.

Read the original → ojas-deshpande.com

Get five bites like this every day.

Tezvyn delivers a daily feed of 60-second tech bites with quizzes to lock in what you learn.

Angular's Default Change Detection with Zone.js · Tezvyn