Bird
0
0

Which of the following is the correct way to declare an input signal in an Angular standalone component?

easy📝 Syntax Q12 of 15
Angular - Signals
Which of the following is the correct way to declare an input signal in an Angular standalone component?
A@Input() inputSignal = signal();
Bconst inputSignal = signal();
Cconst inputSignal = @Input(signal());
Dsignal @Input() inputSignal;
Step-by-Step Solution
Solution:
  1. Step 1: Recall Angular input signal syntax

    Input signals are declared with the @Input() decorator followed by a signal initialization.
  2. Step 2: Check each option

    @Input() inputSignal = signal(); correctly uses @Input() decorator before the signal. const inputSignal = signal(); misses the decorator, C and D have invalid syntax.
  3. Final Answer:

    @Input() inputSignal = signal(); -> Option A
  4. Quick Check:

    Input signals need @Input() decorator [OK]
Quick Trick: Use @Input() before signal declaration [OK]
Common Mistakes:
  • Forgetting the @Input() decorator
  • Placing @Input() incorrectly
  • Using invalid syntax with signals

Want More Practice?

15+ quiz questions · All difficulty levels · Free

Free Signup - Practice All Questions
More Angular Quizzes