Closed indraraj26 closed 2 years ago
ngOnDestroy() { this.hotkeysService.remove(this._hotkeysService.get(['meta+shift+g', 'alt+shift+s'])); } would something like this not just work?
I tried it is working, I have read somewhere you will have to pass same reference in order to prevent memory leak.
Playground: https://stackblitz.com/edit/angular-ivy-ycqk3q?file=src%2Fapp%2Fmy-hotkey.directive.ts
I have created directive that add the key and listen to it, that directive gets applied to my component. How can i ensure about that those listener are destroyed when my component is destroyed.