NG.II · Angular 22 practice question

A developer is building a bidirectional temperature slider where the internal state is held in a Celsius signal. They use `linkedSignal` to derive the Fahrenheit display, ensuring that changing the Fahrenheit value automatically updates the underlying Celsius value. What is the primary mechanism that allows the Fahrenheit setter to modify the source Celsius signal?

const tempC = signal(0);
const tempF = linkedSignal(() => (tempC() * 9) / 5 + 32, {
  set: (valF) => tempC.set(((valF - 32) * 5) / 9),
});
Choose one answer
Check answer and explanation

Correct answer: The `linkedSignal` automatically subscribes to the setter function, which then uses `tempC.set()` to trigger a cascade update.

Explanation

The correct behavior involves the setter passed to `linkedSignal` executing the necessary logic to modify the source signal, which subsequently prompts the derived signal to recalculate, thereby satisfying the condition that 'Setting Fahrenheit updates Celsius, which reactively updates Fahrenheit.'

Common trap

The suggestion that the setter must invoke `tempC.update()` is misleading because the source code illustrates using `set()` for direct value assignment. Furthermore, the claim that `linkedSignal` bypasses standard signal mutation protocols is inaccurate.

Source: Angular docs: Dependent state with `linkedSignal` — Writing back to a source signal
Checked against the cited text on 2026-11-25.

Report an error in this question