Complete the code to create a signal from an observable using Angular's toSignal function.
const countSignal = [1];Use toSignal to convert an observable into a signal in Angular.
Complete the code to update the signal when the observable emits new values.
const countSignal = toSignal(count$[1] { initialValue: 0 });
The options object is passed as a second argument separated by a comma.
Fix the error in the code to correctly convert an observable to a signal with an initial value.
const userSignal = toSignal(user$[1] { initialValue: null });The options object must be passed as the second argument separated by a comma, not with dot or parentheses.
Complete the code to create a signal from an observable and provide an initial value.
const dataSignal = toSignal([1], { initialValue: [] });The observable variable is passed first, then a comma, then the options object.
Fill both blanks to convert an observable to a signal, set an initial value, and access the signal's current value.
const messageSignal = toSignal([1], { initialValue: 'Loading...' }); const currentMessage = messageSignal.[2];
First pass the observable, then a comma, then options. Access the signal's current value with .value.