NG.II · Angular 22 practice question
A developer uses an `OnPush` component and displays a value derived from a signal directly in the template. If the signal's value changes, what is the resulting behavior concerning the component's rendering cycle?
<div *ngIf="signalValue() > 10">Data is high</div>
Check answer and explanation
Correct answer: Angular automatically triggers a change detection cycle specifically for this component to reflect the new signal value.
Explanation
When a signal is accessed within the template of a component configured with `OnPush`, Angular automatically registers this access as a dependency, leading to the component updating when the signal's value changes.
Common trap
Suggesting that manual invocation of change detection is necessary contradicts the inherent automatic dependency tracking provided by signals; asserting that signal reading has no impact on rendering is inaccurate because dependency tracking is established.
Source: Angular docs: guide/signals/overview — Reading signals in `OnPush` components
Checked against the cited text on 2026-11-25.