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 = signal(0);
Dconst count = signal.create(0);
Step-by-Step Solution
Solution:
  1. Step 1: Recall Angular signal syntax

    The correct syntax uses the function signal() to create a signal.
  2. Step 2: Check other options

    Options B, C, and D use incorrect constructors or methods not in Angular's signal API.
  3. Final Answer:

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

    Use signal() function to create signals = A [OK]
Quick Trick: Use signal() function to create signals [OK]
Common Mistakes:
  • Using new keyword with Signal
  • Calling createSignal instead of signal
  • Using dot notation like signal.create

Want More Practice?

15+ quiz questions · All difficulty levels · Free

Free Signup - Practice All Questions
More Angular Quizzes