Removes an attached function which is called after key input processing.
(static) removeAfterKeydownHandler(handler) → {boolean}
Parameters:
Name | Type | Description |
---|---|---|
handler |
function | A function to be removed. |
Returns:
A boolean indicates whether success or not.
- Type
- boolean
Example
angular.module('myApp', ['caph.focus']).controller('myController', ['$scope', 'focusController', function($scope, focusController) {
var calledOnce = false;
var afterHandler = function(context) {
calledOnce = true;
console.log('after moving');
};
focusController.addAfterKeydownHandler(afterHandler);
focusController.addBeforeKeydownHandler(function(context) {
console.log('before moving');
if (!calledOnce) {
focusController.removeAfterKeydownHandler(afterHandler);
console.log('remove handler');
}
});
}]);