Bird
0
0

What is the main purpose of the @Output decorator in Angular?

easy📝 Conceptual Q11 of 15
Angular - Component Interaction
What is the main purpose of the @Output decorator in Angular?
ATo allow a child component to send events to its parent component
BTo receive data from a parent component
CTo style the component's template
DTo import external modules into the component
Step-by-Step Solution
Solution:
  1. Step 1: Understand the role of @Output

    The @Output decorator is used in Angular to create a custom event that a child component can emit to notify its parent component.
  2. Step 2: Differentiate from other decorators

    Unlike @Input which receives data, @Output sends events upward. It does not style or import modules.
  3. Final Answer:

    To allow a child component to send events to its parent component -> Option A
  4. Quick Check:

    @Output sends events from child to parent [OK]
Quick Trick: Remember: @Output sends events up from child to parent [OK]
Common Mistakes:
  • Confusing @Output with @Input
  • Thinking @Output styles components
  • Assuming @Output imports modules

Want More Practice?

15+ quiz questions · All difficulty levels · Free

Free Signup - Practice All Questions
More Angular Quizzes