Q. What does the Angular @HostListener decorator do?

  • (A) Binds a method to a DOM event of the host element
  • (B) Creates a new component
  • (C) Binds data to the host element
  • (D) Defines CSS styles for the host element
πŸ’¬ Discuss
βœ… Correct Answer: (A) Binds a method to a DOM event of the host element
Explanation: @HostListener listens to events on the component’s host element.
Explanation by: Mr. Dubey
@HostListener listens to events on the component’s host element.

πŸ’¬ Discussion


πŸ“Š Question Analytics

πŸ‘οΈ
64
Total Visits
πŸ“½οΈ
1 y ago
Published
πŸŽ–οΈ
Mr. Dubey
Publisher
πŸ“ˆ
90%
Success Rate