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!