Which decorator allows you to listen for events from the children of the current component?

  • @HostListener()
  • @Input()
  • @Output()
  • @ViewChild()
The @ViewChild() decorator in Angular allows you to listen for events and interact with the children of the current component. It is commonly used to access and manipulate child components, directives, or elements within the template. While @Input() and @Output() decorators are used for communication between parent and child components, and @HostListener() is used for listening to events on the host element, none of these directly provide access to children components.
Add your answer
Loading...

Leave a comment

Your email address will not be published. Required fields are marked *