I'm using ngTable for AngularJS and geting the data from a web api. The problem start when I tried to use the filters in the table.
If I do it this way, the table is filled with the data, but the filters don't works:
$scope.clientesTable = new NgTableParams({
page: 1,
count: 10
}, {
getData: function (params) {
var clientes = clientesService.getAll(baseUrl);
clientes.then(function (data) {
$scope.clientesTableData = data.data;
}, function (error) {
console.log("Error: " + error);
});
}
});
In the documentation the code is something like this:
$scope.clientesTable = new NgTableParams({
page: 1,
count: 10
}, {
getData: function (params) {
var clientes = clientesService.getAll(baseUrl);
clientes.then(function (data) {
params.total(data.inlineCount);
return data.results;
}, function (error) {
console.log("Error: " + error);
});
}
});
Doing it this way, I don't see the data in the frontend. If a look for data in clientesTable:

