If you have 8 items in an array and want to display them with 3 items per page, resulting in a total of 3 pages, there is a simple logic involved. However, using ng-repeat to achieve this may not be straightforward. If there isn't a direct method, alternative approaches can be explored.
Essentially, the goal is to split the array into groups of 3 items each:
JS
$scope.items = ["A", "B", "C", "D", "E", "F", "G", "H"];
$scope.pages = Math.ceil($scope.items.length/3);
HTML
<div class="box">
<div class="items" ng-repeat="page in pages">
<!-- place 3 items here before moving onto the next group -->
</div>
</div>
Expected Output
<div class="box">
<div class="items">
<p>A</p>
<p>B</p>
<p>C</p>
</div>
<div class="items">
<p>D</p>
<p>E</p>
<p>F</p>
</div>
<div class="items">
<p>G</p>
<p>H</p>
</div>
</div>