You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Is your feature request related to a problem? Please describe.
I have to add the 'ng-keyboard-shortcuts' component every time i want to subscribe to a shortcut:
<ng-keyboard-shortcuts></ng-keyboard-shortcuts>-----
@ViewChild(KeyboardShortcutsComponent,{static: false})privatekeyboard: KeyboardShortcutsComponent;-----this.keyboard.select('del').subscribe(_=>{// do something});
Describe the solution you'd like
Inject directly the service and use it:
@thoussem
Thank you for your suggestion, older version of the library used to work with a service, but I have decided to have more to a more declarative API and I have left the select option to keep backward compatible.
I was wondering what is the use case? of using the select and not adding an action directly to the shortcut?
not that I am against your suggestion, it could make sense to expose such service given that it is only exposes one method, select.
I mean I am thinking of deprecating the select method on the component and directives, I my self couldn't find a useful case for it. as you can always make a subject and next on it with the event inside the command callback. but again, I assume your use case is valid so I might choose to expose such service, it just I want to keep the surface level of the API as thin as possible and as declarative as possible, and users not have to think about services and life cycles, destruction of events etc...
Is your feature request related to a problem? Please describe.
I have to add the 'ng-keyboard-shortcuts' component every time i want to subscribe to a shortcut:
Describe the solution you'd like
Inject directly the service and use it:
The text was updated successfully, but these errors were encountered: