Practice - 5 Tasks
Answer the questions below
1fill in blank
easyComplete the code to create a signal with initial value 0.
Angular
const count = [1](0);
Drag options to blanks, or click blank then click option'
Attempts:
3 left
💡 Hint
Common Mistakes
Using React's useState instead of Angular's signal
Using ref which is from Vue
Using createSignal which is from SolidJS
✗ Incorrect
In Angular signals, signal is used to create a reactive signal with an initial value.
2fill in blank
mediumComplete the code to read the current value of the signal.
Angular
const currentValue = count[1]; Drag options to blanks, or click blank then click option'
Attempts:
3 left
💡 Hint
Common Mistakes
Using .value which is not Angular syntax
Using .get() from other libraries
Using [] which is invalid
✗ Incorrect
In Angular signals, you read the current value by calling the signal as a function: count().
3fill in blank
hardFix the error in reading the signal value.
Angular
console.log(count[1]); Drag options to blanks, or click blank then click option'
Attempts:
3 left
💡 Hint
Common Mistakes
Using .value incorrectly
Using .get() or .current which are invalid
✗ Incorrect
Access the signal's value by calling it as a function count().
4fill in blank
hardFill both blanks to create a signal and read its value.
Angular
const name = [1]('Alice'); console.log(name[2]);
Drag options to blanks, or click blank then click option'
Attempts:
3 left
💡 Hint
Common Mistakes
Using .value to read
Using ref which is not Angular
✗ Incorrect
Use signal to create and call name() to read the signal.
5fill in blank
hardFill all three blanks to create a signal, update it, and read its value.
Angular
const age = [1](30); age[2](31); console.log(age[3]);
Drag options to blanks, or click blank then click option'
Attempts:
3 left
💡 Hint
Common Mistakes
Trying direct assignment like .value =
Using () for update instead of .set()
Using .current which is not Angular syntax
✗ Incorrect
Create the signal with signal, update with .set(31), read its value by calling age().