Trying to implement a shortcut key combination for Command+S to save a form.
I\'ve read this - https://angular.io/guide/user-input, but it does not say anything about me
Global listener, non-deprecated answer:
@HostListener('window:keydown', ['$event']) onKeyDown(event: KeyboardEvent) { if ((event.metaKey || event.ctrlKey) && event.key === 's') { this.save(); event.preventDefault(); } }