Skip to content

Instantly share code, notes, and snippets.

@AlexAegis
Created April 22, 2019 21:50
Show Gist options
  • Save AlexAegis/8741eb49db8112e6d0c05328d64a5e24 to your computer and use it in GitHub Desktop.
Save AlexAegis/8741eb49db8112e6d0c05328d64a5e24 to your computer and use it in GitHub Desktop.
Angular Megalistener - When you want to hear everything
@HostListener('abort', ['$event'])
@HostListener('afterprint', ['$event'])
@HostListener('animationend', ['$event'])
@HostListener('animationiteration', ['$event'])
@HostListener('animationstart', ['$event'])
@HostListener('beforeprint', ['$event'])
@HostListener('beforeunload', ['$event'])
@HostListener('blur', ['$event'])
@HostListener('canplay', ['$event'])
@HostListener('canplaythrough', ['$event'])
@HostListener('change', ['$event'])
@HostListener('click', ['$event'])
@HostListener('contextmenu', ['$event'])
@HostListener('copy', ['$event'])
@HostListener('cut', ['$event'])
@HostListener('dblclick', ['$event'])
@HostListener('drag', ['$event'])
@HostListener('dragend', ['$event'])
@HostListener('dragenter', ['$event'])
@HostListener('dragleave', ['$event'])
@HostListener('dragover', ['$event'])
@HostListener('dragstart', ['$event'])
@HostListener('drop', ['$event'])
@HostListener('durationchange', ['$event'])
@HostListener('ended', ['$event'])
@HostListener('error', ['$event'])
@HostListener('focus', ['$event'])
@HostListener('focusin', ['$event'])
@HostListener('focusout', ['$event'])
@HostListener('fullscreenchange', ['$event'])
@HostListener('fullscreenerror', ['$event'])
@HostListener('hashchange', ['$event'])
@HostListener('input', ['$event'])
@HostListener('invalid', ['$event'])
@HostListener('keydown', ['$event'])
@HostListener('keypress', ['$event'])
@HostListener('keyup', ['$event'])
@HostListener('load', ['$event'])
@HostListener('loadeddata', ['$event'])
@HostListener('loadedmetadata', ['$event'])
@HostListener('loadstart', ['$event'])
@HostListener('message', ['$event'])
@HostListener('mousedown', ['$event'])
@HostListener('mouseenter', ['$event'])
@HostListener('mouseleave', ['$event'])
@HostListener('mousemove', ['$event'])
@HostListener('mouseover', ['$event'])
@HostListener('mouseout', ['$event'])
@HostListener('mouseup', ['$event'])
@HostListener('mousewheel', ['$event'])
@HostListener('offline', ['$event'])
@HostListener('online', ['$event'])
@HostListener('open', ['$event'])
@HostListener('pagehide', ['$event'])
@HostListener('pageshow', ['$event'])
@HostListener('paste', ['$event'])
@HostListener('pause', ['$event'])
@HostListener('play', ['$event'])
@HostListener('playing', ['$event'])
@HostListener('popstate', ['$event'])
@HostListener('progress', ['$event'])
@HostListener('ratechange', ['$event'])
@HostListener('resize', ['$event'])
@HostListener('reset', ['$event'])
@HostListener('scroll', ['$event'])
@HostListener('search', ['$event'])
@HostListener('seeked', ['$event'])
@HostListener('seeking', ['$event'])
@HostListener('select', ['$event'])
@HostListener('show', ['$event'])
@HostListener('stalled', ['$event'])
@HostListener('storage', ['$event'])
@HostListener('submit', ['$event'])
@HostListener('suspend', ['$event'])
@HostListener('timeupdate', ['$event'])
@HostListener('toggle', ['$event'])
@HostListener('touchcancel', ['$event'])
@HostListener('touchend', ['$event'])
@HostListener('touchmove', ['$event'])
@HostListener('touchstart', ['$event'])
@HostListener('transitionend', ['$event'])
@HostListener('unload', ['$event'])
@HostListener('volumechange', ['$event'])
@HostListener('waiting', ['$event'])
@HostListener('wheel', ['$event'])
public onAnything($event): void {
console.log(`onAnything ${$event.type}`);
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment