Understanding the motivation behind Signals
The main goal behind the Angular team’s introduction of Signals is to add more fine-grained reactivity to the framework. This new Signal-based reactive system marks a significant leap forward in the framework’s ability to handle dynamic data and user interactions. It offers a fresh approach to detecting and triggering changes within the framework, replacing the traditional approach that relies on Zone.js.
The traditional Zone.js approach
Angular’s traditional change detection mechanism assumes that any event handler can potentially change any bound data to the template. That’s why, whenever an event happens in your Angular application, the framework scans all components and their data bindings for any potential changes. This can be a bit heavy-handed, especially for complex applications. For this reason, a more optimized mode OnPush
change detection was introduced. This mode leverages the concepts of immutability...