title: Setting focus on table row elements
body: <p>I have a table list of items that I want to be able to scroll through using the keyboard up and down buttons. I am currently able to get the similar desired effect of moving down the list with the tabindex attribute. I am also using ng repeat to generate the instances of the  elements. Tips or clues on how to achieve being able to focus and scroll up and down the list by using the up and down keys?</p>
  
  <p>Sample code below.</p>
  
  <pre><code>table ng-if="!toolbarCtrl.loadingContacts" class="table dataTable hover" id="table3"&gt;
                  &lt;tbody role="alert" aria-live="polite" aria-relevant="all"&gt;
                      &lt;tr class="pointer" tabindex="0" ng-repeat="contact in toolbarCtrl.contactEntities | filter:toolbarCtrl.toolbarSearchStringAfterDelay | orderBy: toolbarCtrl.tab == toolbarCtrl.tabs.RECENT ? '-dateSeen' : (toolbarCtrl.tab == toolbarCtrl.tabs.ALL ? '+data.fileAs' : '')"
                          ng-class="" ng-if="toolbarCtrl.toolbarSearchStringAfterDelay" ng-click="toolbarCtrl.selectContact(contact)"&gt; 
                          &lt;td rel="popover_dark" ng-class="contact.loading ? 'contactDisabled' : '' " data-container="body" data-toggle="popover" data-placement="right" data-content="" data-original-title="" title="" class="sorting_1 has_popover"&gt;
                          &lt;/td&gt;
                      &lt;/tr&gt;
                  &lt;/tbody&gt;
              &lt;/table&gt;
  </code></pre>
  
  <p>I mutated your checkKey function to become this </p>
  
  <pre><code> controller.checkKey = function (event) {
          $("tr[tabindex=0]").focus();
          var event = window.event;
          if (event.keyCode == 40) { //down
              var idx = $("tr:focus").attr("tabindex");
              idx++;
              if (idx &gt; 6) {
                  idx = 0;
              }
              $("tr[tabindex=" + idx + "]").focus();
          }
          if (event.keyCode == 38) { //up
              var idx = $("tr:focus").attr("tabindex");
              idx--;
              if (idx &lt; 0) {
                  idx = 6;
              }
              $("tr[tabindex=" + idx + "]").focus();
          }
      }
  </code></pre>
  
  <p>I'm close but its skipping straight to the last element. Does this look right?</p>