angular-hotkeys
angular-hotkeys copied to clipboard
How to generate $id of scope in boundScopes
if (!(scope.$id in boundScopes)) {
// Add the scope to the list of bound scopes
boundScopes[scope.$id] = [];
scope.$on('$destroy', function () {
var i = boundScopes[scope.$id].length;
while (i--) {
_del(boundScopes[scope.$id].pop());
}
});
}
how boundScopes generate $id for scope?, if i use action: 'keyup' or 'keydown', boundScopes not del old hotkeys
The $id property is added by Angular when a scope is constructed, and is unique to each scope within the lifecycle of the application; see here. I doubt it's the cause of the issue.