Practice - 5 Tasks
Answer the questions below
1fill in blank
easyComplete the code to create a signal that holds a number value.
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 not Angular syntax.
✗ Incorrect
In Angular signals, signal() creates a reactive value that triggers updates when changed.
2fill in blank
mediumComplete the code to read the current value of a signal inside a component.
Angular
const currentCount = count.[1](); Drag options to blanks, or click blank then click option'
Attempts:
3 left
💡 Hint
Common Mistakes
Trying to access the value directly without calling a method.
Using React or Vue syntax instead.
✗ Incorrect
Use get() to access the current value of a signal in Angular.
3fill in blank
hardFix the error in updating a signal's value.
Angular
count.[1](count.get() + 1);
Drag options to blanks, or click blank then click option'
Attempts:
3 left
💡 Hint
Common Mistakes
Using non-existent methods like update or change.
Trying to assign value directly.
✗ Incorrect
To update a signal's value, use the set() method with the new value.
4fill in blank
hardFill both blanks to create a computed signal that doubles the count.
Angular
const doubleCount = computed(() => count.[1]() [2] 2);
Drag options to blanks, or click blank then click option'
Attempts:
3 left
💡 Hint
Common Mistakes
Using addition instead of multiplication.
Not calling get() to read the signal.
✗ Incorrect
Use get() to read the signal and * to multiply by 2.
5fill in blank
hardFill all three blanks to create a signal, update it, and read its value.
Angular
const score = [1](10); score.[2](score.get() [3] 5);
Drag options to blanks, or click blank then click option'
Attempts:
3 left
💡 Hint
Common Mistakes
Using update instead of set.
Using subtraction instead of addition.
✗ Incorrect
Create a signal with signal(), update it with set(), and add 5 using +.