1

I want angular js pagination with next prev button and in between i need a textbox to go direct to any page number in angular js table please help me

Zeeshan Saleem
  • 149
  • 4
  • 15

1 Answers1

0

This post will give you a head start for your approach.

How to achieve pagination/table layout with Angular.js?

Regarding textbox based page change, you will have to bind the current page number to the text box.

Edit :

This is a js fiddle from the above post.

http://jsfiddle.net/SAWsA/1754/

Add this line before the Next Prev buttons:

<input type="text" ng-model="currentPageManual"/> 

& In the controller , Add these lines :

$scope.currentPageManual = 1;


$scope.$watch("currentPage", function(newValue, oldValue) {
    $scope.currentPageManual = newValue+1;
    });


    $scope.$watch("currentPageManual", function(newValue, oldValue) {
    $scope.currentPage = newValue-1;
    });

I am sure there are elegant ways of doing this..

Community
  • 1
  • 1
Abdul Rehman Sayed
  • 6,532
  • 7
  • 45
  • 74