title: Call function using keypress in Angularjs
body: <p>I have a method that gets called inside a div tag using <code>ng-click="startChat()"</code> - it works fine.</p>
  
  <p>I would like the same function to be called there when pressing down a key, let's say 'p' in this case which has a keycode of 112.</p>
  
  <p>I tried adding the following to the div:</p>
  
  <pre><code>ng-keydown="$event.keyCode == 112 ? startChat()"
  </code></pre>
  
  <p>I also tried the same with ng-keyupp but nothing happens. Does someone know why and how can I achieve the task? </p>