I have a requirement where I have to focus to a particular row when the items are displayed using ng-repeat.
Let us say that I have a list of 100 items with each item having field, itemId ranging from 1 to 100, itemName and isAvailable. This list is fetched from the server using an ajax call from the angularjs service that I wrote. The controller in turn uses this service to make the ajax call. When the response is retrieved, I am displaying this list on the UI using ng-repeat. Eveything is fine so far, but I want to automatically focus to an item which has an itemId value of lets say 50 when the page is loaded. I want to to this from the controller side.
Below is the code that I currently have.  
HTML
<div id="eventTypes" class="panel-body">
    <div ng-repeat="item in items" class="panel-body">
        <div class="row">
            <div class="col-md-9">{{item.itemId)}}</div>
            <div class="col-md-9">{{item.itemName)}}</div>
            <div class="col-md-9">{{item.isAvailable)}}</div>
        </div>
    </div>
</div>  
JS
(function () {
    'use strict';
    angular.module('myApp').controller('itemsController', function ($scope, itemsService) {
        var serviceError = function (errorMsg) {
            console.log(errorMsg);
        };
        $scope.items = [];
        $scope.loaditems = function () {
            itemsService.getitems().then(function (response) {
                $scope.items = response.data;
            }, serviceError);
        };
        $scope.loaditems();
    });
}());  
The above code works fine. It is displaying the items on the UI. But, I want to automatically focus (scroll) to the item number 50 when the page is loaded.
 
     
     
     
     
    