NG.I · Angular 22 practice question

A developer is building a component where a user's current theme setting is managed by an Angular signal. How must the developer access the theme value within the component's template to ensure the UI updates automatically when the signal changes?

theme = signal('dark');

// In template:
<p>Theme is: {{ theme }}</p>
Choose one answer
Check answer and explanation

Correct answer: {{ theme() }}

Explanation

The correct approach, as demonstrated for signals, is to call the signal function in the template: "Your color preference is {{ theme() }}."

Common trap

Using `{{ theme }}` treats the signal object as a primitive value, which does not trigger reactivity for signals. Using `{{ theme.value }}` is an outdated or incorrect pattern for accessing signal values in the template.

Source: Angular docs: Binding dynamic text, properties and attributes — Render dynamic text with text interpolation
Checked against the cited text on 2026-11-25.

Report an error in this question