angular-hotkeys icon indicating copy to clipboard operation
angular-hotkeys copied to clipboard

Calling Mousetrap.trigger fails

Open martinsznapka opened this issue 11 years ago • 4 comments

If you call Mousetrap.trigger('?') it ends up with error.

Quick bugfix didn't help: Surrounding $rootScope.apply with $timeout http://stackoverflow.com/a/18996042

martinsznapka avatar Aug 29 '14 08:08 martinsznapka

The more info you provide in a bug report, the higher the chances I'll be able to fix it. Could you provide a plunkr or at least the error you're getting?

chieffancypants avatar Sep 04 '14 23:09 chieffancypants

http://plnkr.co/edit/hutNuYRotIyJYqqAYZk2?p=preview

martinsznapka avatar Sep 09 '14 10:09 martinsznapka

Thanks -- I've updated the plunkr to work (you can't link directly to raw.github as the mime types don't match)

http://plnkr.co/edit/YktmMkbN0O5CTN2LQngt

Any reason you want to trigger from outside hotkeys? If you simply want to show the cheatsheet, there is a service method (toggleCheatSheet) available to do that

chieffancypants avatar Sep 10 '14 17:09 chieffancypants

F.e.:

  • if you want to use Mousetrap directly
  • any other plugin depends on Mousetrap

martinsznapka avatar Sep 10 '14 18:09 martinsznapka