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

bindTo equivalent for component controller?

Open samjulien opened this issue 8 years ago • 2 comments

Hi folks,

I recently upgraded my app to Angular 1.5.8 and am gradually converting my controllers and directives to components. In my directives I was doing:

hotkeys.bindTo(scope)
           .add(
               {
                   combo: 'p f',
                   description: 'Create a forecast for a project',
                   callback: function () {
                       vm.openGroup = true;
                       vm.edit();
                   }
               }
            )

This no longer works with a component's controller. For now I'm just going to use the $onDestroy lifecycle hook to remove the hotkeys, but this will get tedious, especially on pages with lots and lots of hotkeys. Thoughts?

P.S. It also looks like chaining adds no longer works, unless I'm missing something.

Thanks so much, this is a great directive!

samjulien avatar Aug 11 '16 20:08 samjulien

I am in the same boat. I will try to use the route hotkeys, if that doesnt work I must look for another package I guess.

IngoW avatar Sep 01 '16 19:09 IngoW

@samjulien can you tell me why this doesn't work?

tcrite avatar Jan 04 '17 20:01 tcrite