omridevk / ng-keyboard-shortcuts

Dead Simple Keyboard Shortcuts Management for Angular

Home Page:https://ng-keyboard-shortcuts.vercel.app/

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

How to dynamically add key shortcuts?

co-dax opened this issue · comments

I have tried to add key shortcuts dynamically by adding new objects to the list binded to property "shortcuts" but it doesn't work.
Documentation mentions in some places it is possible to do it. What am I supposed to do?

Thanks.

commented

would be best if you could provide a minimal reproduction repo, you can use the codesandbox here:
https://codesandbox.io/s/yvyovny43v

Here is an example https://codesandbox.io/s/ng-keyboard-shortcuts-example-forked-bi14kw?file=/src/app/app.component.ts
Clicking on button "Add New Shortcut" should add a new shortcut "cmd + b" which should log related event but it does not happen.

Thanks!

commented

Thanks, I will look into it, thanks for reporting.