title: Change focus to input on a key event in AngularJS
body: <p>Test case: <a href="http://jsbin.com/ahugeg/4/edit">http://jsbin.com/ahugeg/4/edit</a> (Slightly long)</p>
  
  <p>In the above test case, I have three input elements, generated by <code>ng-repeat</code> directive. My intention in this test case, is that hitting the up/down arrows in one of these inputs should move focus to the input in the corresponding direction, if there is an input available in that direction.</p>
  
  <p>I am new to AngularJS, so I might be missing on some straightforward way to do this. Anyway, I defined two new directives (<code>on-up</code> and <code>on-down</code>), to handle the up and down events and am calling the <code>$scope.focusNext</code> and <code>$scope.focusPrev</code> methods, passing the correct entry, relative to which the focus should move. This is where I am stuck.</p>
  
  <p>I know it is not the <em>angular-way</em> to deal with DOM elements in controllers, but I can't see how the <em>focus</em> can be seen as an attribute/property of a model. I even thought of having a separate <code>$scope.focusedEntry</code>, but then should I <em>watch</em> for changes on that property? Even if I do and I detect changes, how can I access the input element corresponding to the entry I want focused?</p>
  
  <p>Any help on how this should be done are very much appreciated.</p>