What is linkedSignal, and when would you use it instead of computed?

Angular signals and change detection · Experienced

Model answer

linkedSignal creates a writable signal whose value is derived from another signal, but can also be overwritten. When the source changes, it resets to the derived value. A typical example: a selected item that defaults to the first option of a list, but the user can change it, and it resets when the list changes.

computed is read-only, so it cannot hold a user choice. Use linkedSignal when you need "derived default that can be edited".

Learn this topic

Angular Tutorial: Beginner to Advanced .

Sign in to add your own answer.

More questions