Bird
0
0

Which of the following is the correct way to create a signal in Angular?

easy📝 Syntax Q12 of 15
Angular - Signals
Which of the following is the correct way to create a signal in Angular?
Aconst count = createSignal(0);
Bconst count = new Signal(0);
Cconst count = observable(0);
Dconst count = signal(0);
Step-by-Step Solution
Solution:
  1. Step 1: Recall Angular signal creation syntax

    Angular uses the signal() function to create reactive signals.
  2. Step 2: Check options for correct syntax

    Only const count = signal(0); matches Angular's official syntax.
  3. Final Answer:

    const count = signal(0); -> Option D
  4. Quick Check:

    Use signal() function = C [OK]
Quick Trick: Use signal() function, not new or createSignal [OK]
Common Mistakes:
  • Using new Signal() instead of signal()
  • Confusing with createSignal() from other frameworks
  • Using observable() which is for RxJS

Want More Practice?

15+ quiz questions · All difficulty levels · Free

Free Signup - Practice All Questions
More Angular Quizzes