Just starting out with angularjs and looking to implement pagination for dynamically generated table rows. The goal is to display pagination after every 3 rows are added, but currently it's not working as expected - even though the limit is set to 3 in the controller (script.js). For a demo, please visit the following link: http://plnkr.co/edit/aViHHoqLBSSiIVMh2KkH?p=preview
`<tr ng-repeat="sum in priceSumRow | filter : paginate">`
buySellApp.controller('buySellCtrl', ['$scope', function($scope) {
$scope.totalItems = $scope.priceSumRow.length;
$scope.currentPage = 1;
$scope.numPerPage = 5;
$scope.paginate = function(value) {
var begin, end, index;
begin = ($scope.currentPage - 1) * $scope.numPerPage;
end = begin + $scope.numPerPage;
index = $scope.priceSumRow.indexOf(value);
return (begin <= index && index < end);
};
}]);