Angular · Middle · Question 7 of 75

What does linkedSignal solve?

options = input.required<string[]>();
selected = linkedSignal(() => this.options()[0]);

Explanation

The user can selected.set(...) a different option, but when options changes the selection is recomputed. Before linkedSignal, this needed an effect that wrote into another signal.

Further reading

Problem with a question

Angular · Middle · question 7

Test yourself

Take the Angular · Middle quiz: questions and options are shuffled, and you get a review of your mistakes at the end.

Take this quiz