<!DOCTYPE html> <html lang="en" ng-app="myModule"> <head> <meta charset="UTF-8" name="viewport" content="width=device-width, initial-scale=1"/> <link rel="stylesheet" type="text/css" href="css/bootstrap.css"/> </head> <body> <nav class="navbar navbar-default"> <div class="container-fluid"> </div> </nav> <div class="col-md-6 well"> <hr style="border-top:1px dotted #ccc;"/> <div class="col-md-7"> <div ng-controller="myController"> <table class="table table-bordered"> <thead class="alert-info"> <tr> </tr> </thead> <tbody> <tr dir-paginate="member in members|orderBy:'lastname'|itemsPerPage:4"> </tr> </tbody> </table> <dir-pagination-controls direction-links="true" boundary-links="true" > </dir-pagination-controls> </div> </div> </div> </body> </html>
var app = angular.module('myModule', ['angularUtils.directives.dirPagination']); app.controller('myController', function($scope){ var members = [ {firstname: "Jason", lastname: "Smith", address: "USA"}, {firstname: "Mraz", lastname: "Cullen", address: "Tokyo"}, {firstname: "Abida", lastname: "Mercy", address: "Germany"}, {firstname: "Steve", lastname: "Roger", address: "China"}, {firstname: "Claire", lastname: "Temple", address: "Belgum"} ]; $scope.members = members; }); </code> There you have it we successfully created a <strong>Pagination Array</strong> using AngularJS. I hope that this simple tutorial help you to what you are looking for. For more updates and tutorials just kindly visit this site. Enjoy Coding!!