src/hotkeys.js
function bindTo (scope) {
        // Only initialize once to allow multiple calls for same scope.
        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());
            }
          });
        }
        // return an object with an add function so we can keep track of the
        // hotkeys and their scope that we added via this chaining method
        return {
          add: function (args) {
            var hotkey;

            if (arguments.length > 1) {
              hotkey = _add.apply(this, arguments);
            } else {
              hotkey = _add(args);
            }

            boundScopes[scope.$id].push(hotkey);
            return this;
          }
        };
      }
function bindTo (scope) {
        // Only initialize once to allow multiple calls for same scope.
        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());
            }
          });
        }
        // return an object with an add function so we can keep track of the
        // hotkeys and their scope that we added via this chaining method
        return {
          add: function (args) {
            var hotkey;

            if (arguments.length > 1) {
              hotkey = _add.apply(this, arguments);
            } else {
              hotkey = _add(args);
            }

            boundScopes[scope.$id].push(hotkey);
            return this;
          }
        };
      }
function bindTo ( scope ) { // Only initialize once to allow multiple calls for same scope. 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 ( ) ) ; } } ) ; } // return an object with an add function so we can keep track of the // hotkeys and their scope that we added via this chaining method return { add : function ( args ) { var hotkey ; if ( arguments . length > 1 ) { hotkey = _add . apply ( this , arguments ) ; } else { hotkey = _add ( args ) ; } boundScopes [ scope . $id ] . push ( hotkey ) ; return this ; } } ; }
Binds the hotkey to a particular scope.  Useful if the scope is
destroyed, we can automatically destroy the hotkey binding.

@param  {Object} scope The scope to bind to
Binds the hotkey to a particular scope . Useful if the scope is destroyed we can automatically destroy the hotkey binding .