This is my working Pagination:
http://plnkr.co/edit/WmC6zjD5srtYHKopLm7m
Here is a summary of my code:
var app = angular.module('hCms', []);
app.controller('samplecontoller', function ($scope, $http) {
$scope.showData = function(){
$scope.method = 'GET';
$scope.url = 'homes.json';
$scope.code = null;
$scope.response = null;
$scope.curPage = 0;
$scope.pageSize = 3;
$http({method: $scope.method,url: $scope.url}).
success(function(data, status) {
$scope.status = status;
$scope.datalists = data;
}).
error(function(data, status) {
$scope.datalists = data || "Request failed";
$scope.status = status;
});
$scope.numberOfPages = function() {
return Math.ceil($scope.datalists.length / $scope.pageSize);
};
}
});
angular.module('hCms').filter('pagination', function()
{
return function(input, start)
{
start = +start;
return input.slice(start);
};
});
Code works with no issues.
Now if you please type in the search field "Dis" which there is an entry for it under page 3. Search brings nothing. I need to run the search on the $scope.datalist at the controller(I think) not as a filter.
Can someone please put me in the right direction or suggest some info in this matter?
Thanks guys,
H.