I am getting more than 10000 records from back-end in Angular premise call. I am using Premise to call API method in service and subscribe the same in component and getting too much records as a result set.
The problem is that my UI can't handle this much records and as a result browser gets hanged totally. So can any one tell me how to handle such a situation ?
This is my sample code in which I am getting more than 10000 records.
this.myService.getData(this.mongodbQuery).then((data: any) => {
try{
if(data.operation == "SUCCESS"){
if(data.data === "]")
{
that.toastr.warning("No results found, please refine your conditions!","Report");
}else{
that.reportResult = JSON.parse(that.stringifyJson(data));
}
}
else{
that.toastr.warning("Data size is larger, please refine your conditions!","Report"); // Here it doesn't give me result because records are more than 10000
}
}
catch(err){
$('#loading').hide();
that.toastr.warning("Data size is larger, please refine your conditions!","Report");
}
},function(err){
$('#loading').hide();
that.toastr.warning("Data size is larger, please refine your conditions!","Report");
});