0
0
Angularframework~10 mins

Why signals are introduced in Angular - Test Your Understanding

Choose your learning style9 modes available
Practice - 5 Tasks
Answer the questions below
1fill in blank
easy

Complete the code to create a signal in Angular.

Angular
const count = [1](0);
Drag options to blanks, or click blank then click option'
Asignal
BuseState
Cref
Dreactive
Attempts:
3 left
💡 Hint
Common Mistakes
Using React hooks like useState instead of Angular signals.
Using ref which is from Vue, not Angular.
2fill in blank
medium

Complete the code to update a signal's value.

Angular
count.[1]((prev) => prev + 1);
Drag options to blanks, or click blank then click option'
Aset
Bupdate
Cnext
Dchange
Attempts:
3 left
💡 Hint
Common Mistakes
Using set which replaces the value directly, not updates it.
Using non-existent methods like next or change.
3fill in blank
hard

Fix the error in the code to read a signal's value.

Angular
const current = count[1];
Drag options to blanks, or click blank then click option'
A.get()
B.value
C[]
D()
Attempts:
3 left
💡 Hint
Common Mistakes
Trying to access a property like .value which does not exist.
Using square brackets which are invalid here.
4fill in blank
hard

Fill both blanks to create a computed signal that doubles the count.

Angular
const doubleCount = [1](() => count() [2] 2);
Drag options to blanks, or click blank then click option'
Acomputed
B*
C+
Dsignal
Attempts:
3 left
💡 Hint
Common Mistakes
Using signal instead of computed for derived values.
Using addition + instead of multiplication.
5fill in blank
hard

Fill all three blanks to create a signal, update it, and read its value.

Angular
const score = [1](10);
score.[2](prev => prev [3] 5);
Drag options to blanks, or click blank then click option'
Asignal
Bupdate
C+
Dcomputed
Attempts:
3 left
💡 Hint
Common Mistakes
Using computed to create the initial signal.
Using set instead of update when a function is passed.
Using subtraction - instead of addition.