Matt Simoncavage
Posts: 0
Joined: Thu Jun 04, 2015 7:10 pm

No Results message Ionic

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!

Serhii Kulibaba
Posts: 150
Joined: Tue Aug 27, 2013 1:47 pm

No Results message Ionic

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

Matt Simoncavage
Posts: 0
Joined: Thu Jun 04, 2015 7:10 pm

No Results message Ionic

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

Return to “Issues”