I am struggling with implementing server-side paging in my AngularJS app. I am loading a large amount of data from the server and displaying it in a data table using angular-datatables. Currently, my HTML code is structured like this:
<table datatable="orders" dt-options="dtOptions" dt-column-defs="orderColumns">
<thead>
<tr>
<th>ID</th>
<th>Date</th>
<th>Customer</th>
<th>Amount</th>
</tr>
</thead>
<tbody>
<tr ng-repeat="order in orders">
<td>{{order.ID}}</td>
<td>{{order.OrderDate}}</td>
<td>{{order.Customer}}</td>
<td>{{order.Amount}}</td>
</tr>
</tbody>
</table>
The properties are bound to my controller, which is set up as follows:
$scope.currentPageNumber = 1;
$scope.dtOptions = {displayLength: 25, deferRender: true};
$scope.orders = [];
$scope.loadOrders = function() {
// make request to server to retrieve orders for the selected page
// getOrders($scope.currentPageNumber);
};
Despite reviewing the documentation, I'm unsure how to handle the pager control for server-side paging. Any guidance on this would be greatly appreciated!
Thank you!