Page 1 of 1

No Results message Ionic

Posted: Fri Jul 22, 2016 11:54 pm
by Matt Simoncavage

Hi, can you please tell me how I can take a certain action (such as display a 'No Results' message) when a query service doesn't return any results in Ionic? I tried using the error event in the query's function, but it did not work. Thanks!


No Results message Ionic

Posted: Sat Jul 23, 2016 10:05 am
by Serhii Kulibaba

Please check the length of the response data on the success event of that service.
preif (!success.data.length){
alert("No results");
}/pre


No Results message Ionic

Posted: Sat Jul 23, 2016 4:27 pm
by Matt Simoncavage

Thanks Sergiy, I knew it had to be something like that I was just confused on where exactly to add the code. It worked!