A

Admin • 832.27K Points
Coach

Q. What does the @HostListener decorator do in Angular?

  • (A) Binds a method to a DOM event of the host element
  • (B) Listens to changes in child components
  • (C) Handles HTTP requests
  • (D) Creates a new component
  • Correct Answer - Option(A)
  • Views: 12
  • Filed under category Angular JS
  • Hashtags:

Explanation by: Admin

@HostListener listens to events on the host element and triggers the decorated method.

You must be Logged in to update hint/solution

Discusssion

Login to discuss.

Be the first to start discuss.