Q: How can I use AngularJS to trigger a function when someone presses the return key? I had something like the following when I was using jquery:
if (e.keyCode == 13){
    var functionName = $('.myClass').prop("onclick");
    if($('#myTable > tbody > tr').hasClass('myClass')) {
        setTimeout(functionName, 0)
        return false;
    }
}

<tr id="item1" onclick="function1()">
    // stuff
</tr>
<tr id="item2" class="myClass" onclick="function2()">
    // stuff
</tr>
<tr id="item3" onclick="function3()">
    // stuff
</tr>

Basically, I have a bunch of table rows. A row is "selected" if it has the class myClass. If the user presses the return key, then the function associated with the row that has the class myClass will be executed.
How can I do the same thing using angular? That is, my function uses ng-click instead of jquery's onclick. I tried making the following substitution, but it didn't work:
var functionName = $('.myClass').prop("ng-click");

<tr id="item2" class="myClass" ng-click="function2()">
    // stuff
</tr>

Any suggestions?

A: The built in ng-keypress? 
http://docs.angularjs.org/api/ng.directive:ngKeypress
Your original jQuery way is quite roundabout, rather than trigger the onclick you should have abstracted the function away and used an event listener to trigger it. Read up on unobtrusive javascript re: this.
I think what you are looking for is,
In your controller something like:
$scope.selectedEl = 0;

$scope.setSelectedEl = function(ref){
  $scope.selectedEl = ref;
}

$scope.pressKey = function($event){
  if($event.keyCode === 13){
  console.log('the key pressed was enter, execute something')
  }
}

In your view something like:
<div ng-keypress="pressKey($event)">
<ul>
  <li ng-click="setSelectedEl('reference')">
</ul>
</div>

In the case of an ng-repeat use $index as the reference, but you don't mention using that.
This is pseudocode / untested anyway, but should provide a general strategy I think would achieve what you want.
