A deep dive into how Angular's experimental zoneless change detection works without Zone.js. Zone.js traditionally patches EventTarget.prototype.addEventListener to trigger change detection on every event. With provideExperimentalZonelessChangeDetection, Angular instead hooks into its compiler to wrap template event bindings with a wrapListener function that calls markViewDirty directly, bypassing the need for Zone.js monkey-patching entirely. The post traces the call chain through Angular's source code: from DomEventsPlugin to EventManager to DefaultDomRenderer2 to listenerInternal, showing exactly where markViewDirty is invoked.

6m read timeFrom playfulprogramming.com
Post cover image
Table of contents
Post contents

Sort: