chieffancypants / angular-hotkeys

Configuration-centric keyboard shortcuts for your Angular apps.
http://chieffancypants.github.io/angular-hotkeys/
MIT License
1.68k stars 248 forks source link

Bugfix - Deleting multiple keys when the directive is destroyed #199

Closed atticoos closed 8 years ago

atticoos commented 8 years ago

Previously, when a directive links and adds all the keys, it would only track the last key iterated.

When the directive is destroyed, only the last key is removed. The others become leaked.

This PR tracks the keys as an array, such that when the directive is destroyed, it ensures all keys are removed by looping through they all the keys that were added.

Tests have been added for this change.

chieffancypants commented 8 years ago

Nice!

atticoos commented 8 years ago

Woah, forgot about this. ha :+1: