Complete the code to create a signal in Angular.
const count = [1](0);
In Angular, signal is used to create reactive state that updates the UI automatically.
Complete the code to update a signal's value.
count.[1]((prev) => prev + 1);
set which replaces the value directly, not updates it.next or change.The update method changes the signal's value based on the current value.
Fix the error in the code to read a signal's value.
const current = count[1];.value which does not exist.Signals are functions, so to get their value you call them with ().
Fill both blanks to create a computed signal that doubles the count.
const doubleCount = [1](() => count() [2] 2);
signal instead of computed for derived values.+ instead of multiplication.computed creates a signal derived from others. Multiplying count by 2 doubles it.
Fill all three blanks to create a signal, update it, and read its value.
const score = [1](10); score.[2](prev => prev [3] 5);
computed to create the initial signal.set instead of update when a function is passed.- instead of addition.Create a signal with signal, update it with update, and add 5 using +.
