Whenever a checkbox is checked, I want to listen for if a key is pressed and run some code. That code will need to access the checkbox value or ngModel. I have considered something like
<input ng-repeat="task in $store.taskarr track by $index" ng-change="checked(task)" ng-model="task" type="checkbox" value="{{task}}" />
controller('checkboxController', function($scope){
$scope.checked = function(task){
//here goes something like a keydown-listener if task is true
console.log(task);
}
}).
I have to problems with my approach.
Console.log returns true/false, not the value from {{task}} as I expected. I'm not sure if I should use the ng-keydown-event or onkeydown. The event needs to be global, as more than one checkbox can be checked at the same time.
If you would prefer another approach like an attribute directive or something else, I'm all ears!