I am working on a small application that displays a "users" JSON in an HTML5 table. It uses Bootstrap 3 and AngularJS. I want to paginate this table.
I do not have an array to loop through, with ng-repeat. I have a number the number of pages.
With jQuery, I would do:
var pageMax = 10;
var paginationItems = [];
for(var i=0; i<pageMax; i++){
var paginationItem = '<li><a href="#">' + (i + 1) + '</a></li>';
paginationItems.push(paginationItem);
}
var paginationSum = paginationItems.reduce((a, b) => a + b, '');
$('.pagination').html(paginationSum);
<script src="https://ajax.googleapis.com/ajax/libs/jquery/3.1.1/jquery.min.js"></script>
<link href="http://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/css/bootstrap.min.css" rel="stylesheet"/>
<div class="text-center">
<ul class="pagination"></ul>
</div>
What is the equivalent of the above for loop in AngularJS?
` – Aleksey Solovey Jul 13 '18 at 13:53