This is how i did
Html
<input type="text" ng-model="searchUser">
<table ng-table="tableParams">
<tr ng-repeat="user in $data">
...
</tr>
</table>
Script
var usersData = []; // initial data
$scope.tableParams = new ngTableParams({
page: 1,
count: 7
}, {
counts : [7,14,21,28],
getData: function($defer, params) {
var searchedData = searchData();
params.total(searchedData.length);
$scope.users = searchedData.slice((params.page() - 1) * params.count(), params.page() * params.count());
$defer.resolve($scope.users);
},
$scope: { $data: {} }
});
$scope.$watch("searchUser", function () {
$scope.tableParams.reload();
});
var searchData = function(){
if($scope.searchUser)
return $filter('filter')(usersData,$scope.searchUser);
return usersData;
}
Remaining default ngtable
configuration.