In Angular 2, we are used to listening for events on the Component’s DOM elements, however how do we listen to events outside of this range? Angular 2 provides a HostListener Decorator in order to match an event triggered on a target with a function declared on the next line.
Full article