How to retain the scroll position of ng-repeat in AngularJS when removing an item from the top
I tried to work from the solution to this How to retain scroll position of ng-repeat in AngularJS? to achieve retaining the scroll position when removing the top item in an ng-repeat but couldn't figure out the code to do so. Also, side note, the list should print in the same order as the items array, not in the reverse as the example does. The solution's code: angular.module("Demo", []) .controller("DemoCtrl", function($scope) { $scope.items = []; for (var i = 0; i < 10; i++) { $scope.items[i] = { id: i, name: 'item ' + i }; } $scope.addNewItem = function() { $scope.items = $scope.items