Bird
0
0

How do you correctly declare an @Input property called title inside a child component class?

easy📝 Syntax Q3 of 15
Angular - Component Interaction
How do you correctly declare an @Input property called title inside a child component class?
Ainput title: string;
B@Input() title: string;
C@Output() title: string;
Dpublic title: @Input string;
Step-by-Step Solution
Solution:
  1. Step 1: Syntax of @Input

    The @Input decorator is placed before the property declaration.
  2. Step 2: Correct declaration

    The property should be declared as @Input() title: string; to receive input.
  3. Final Answer:

    @Input() title: string; -> Option B
  4. Quick Check:

    @Input decorator precedes property declaration [OK]
Quick Trick: @Input() before property name declares input [OK]
Common Mistakes:
  • Using @Output instead of @Input
  • Missing parentheses after @Input
  • Incorrect property declaration syntax

Want More Practice?

15+ quiz questions · All difficulty levels · Free

Free Signup - Practice All Questions
More Angular Quizzes