Is the value changing when viewed in the console? Check it out here: http://jsfiddle.net/LCZfd/1006/
app.controller("myCtrl", function($document) {
let scope=this;
this.current=0;
this.isCurrent=function(val){
return val==this.current;
}
this.selectCurrent=function(val){
this.current=val;
}
$document.on('keypress', keyupHandler);
function keyupHandler(keyEvent) {
scope.selectCurrent(keyEvent.key-1);
console.log(scope.current);
}
});
Observe how the variable changes its value in the console. I only want to use the keyboard within my app.