I have one issue that one of companies has so many data that make to load so long to be displayed in my AngularJs project. Sometimes, it does not appear when kind of connection is cut off or request time out. At that time, what my client is to show some message and re-run that function again to reload data. Backend is using NodeJS.
Please help me how to full-fill my client's request.
Here is my code to get data from backend.
$scope.tableParams = new ngTableParams({
page: 1, // show first page
count: 20, // count per page
sorting: {
title: 'asc' // initial sorting
},
filter: {
title: filterText,
is_active: $scope.IsActive
}
}, {
total: 0,
getData: function ($defer, params) {
companyService.getDataBelongToCompany($scope.companyId, params.url()).then(function (data) {
params.total(data.total);
$defer.resolve(data.jobs);
$scope.collapsed = false;
}, function () {
$defer.resolve([]);
});
}
});