Angular signals change how a component tells the framework that something on screen is out of date. Combined with OnPush change detection, they let Angular skip almost every component on every tick and re-render only the ones whose data changed.
What a signal is
A signal is a value with a list of readers. When you call count() inside a template, Angular records that the template depends on count . When you call count.set(5) , Angular knows exactly which views need to update.
readonly count = signal ( 0 ) ; readonly doubled = computed ( ( ) => this . count ( ) * 2 ) ;
increment ( ) { this . count . update ( n => n + 1 ) ; }
Enter fullscreen mode
Exit fullscreen mode
computed is lazy and cached. It recalculates only when one of the signals it read has changed, and only when someone reads it.
Why OnPush matters
With the default strategy, Angular checks every component after every event, timer and HTTP response. On a small page that is fine.…