<h1>Example: ngKeydown / ngKeyup</h1>
<p>ngKeydownはkeydownイベント、ngKeyupはkeyupイベントをリスナー登録します。</p>
<div ng-app="myApp">
  <div ng-controller="myController">
    <input type="text" ng-keydown="keydown()" ng-keyup="keyup()">
    
    <p>
      Keydown: {{ keyDownCount }} <br />
      Keyup: {{ KeyUpCount }}
    </p>
  </div>
</div>
@import "bourbon";

body {
  padding: 1.5rem;
}
View Compiled
var app = angular.module('myApp', []);

app.controller('myController', ['$scope', function($scope){
  $scope.keyDownCount = 0;
  $scope.KeyUpCount   = 0;
  
  $scope.keydown = function(){
    $scope.keyDownCount++;
  }
  
  $scope.keyup = function(){
    $scope.KeyUpCount++;
  }
}]);

External CSS

This Pen doesn't use any external CSS resources.

External JavaScript

  1. https://ajax.googleapis.com/ajax/libs/angularjs/1.3.2/angular.min.js