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']).config(['focusControllerProvider', function(focusControllerProvider) {
var calledOnce = false;
var afterHandler = function(context, controller) {
calledOnce = true;
console.log('after moving');
};
focusControllerProvider.addAfterKeydownHandler(afterHandler);
focusControllerProvider.addBeforeKeydownHandler(function(context, controller) {
console.log('before moving');
if (!calledOnce) {
focusControllerProvider.removeAfterKeydownHandler(afterHandler);
console.log('remove handler');
}
});
}]);