4

In my web application, I let the user use the arrow keys to go up and down a large list set up using ng-repeat:

<li ng-repeat="vpn in vpns 
          | orderBy: 'Title' 
          | customFilter:searchString" 
          ng-class="{'highlight': $index == focusIndex }"> 

the current <li> gets class highlight. I'd also like to scroll the page to their current selection, as each <li> is large, and the page only can show about 3 at a time. I know i can use $location and $anchorScroll to scroll to an id via the documentation but I can't figure out how to scroll to a class, or to use some sort of ng-id similar to ng-class (only one element will be highlighted at a time).

If anyone could offer me a few pointers that would be great. Thankyou!

Jonesopolis
  • 25,034
  • 12
  • 68
  • 112
  • 1
    I know it's a bit ttlate but here you may have your answer : http://stackoverflow.com/questions/23655009/how-to-set-the-id-attribute-of-a-html-element-dynamically-with-angular-js – Truche May 14 '15 at 10:55

0 Answers0