Bird
0
0

Which syntax correctly defines an input property in a dumb component to receive data from a smart component?

easy📝 Syntax Q3 of 15
Angular - Advanced Patterns
Which syntax correctly defines an input property in a dumb component to receive data from a smart component?
A@Input() data: string;
B@Output() data: string;
Cdata = @Input();
Dinput data: string;
Step-by-Step Solution
Solution:
  1. Step 1: Recall Angular input syntax

    Angular uses the @Input() decorator before a property to mark it as an input.
  2. Step 2: Check options for correct syntax

    @Input() data: string; uses @Input() correctly. Options A, C, and D are invalid syntax.
  3. Final Answer:

    @Input() data: string; -> Option A
  4. Quick Check:

    @Input decorator syntax = @Input() property [OK]
Quick Trick: Use @Input() before property to receive data [OK]
Common Mistakes:
  • Using @Output instead of @Input
  • Incorrect decorator placement
  • Invalid TypeScript syntax

Want More Practice?

15+ quiz questions · All difficulty levels · Free

Free Signup - Practice All Questions
More Angular Quizzes