i have this function
searching() {
this._demoService.postData(this.url,this.searchtobesent).subscribe(
data =>{
this.listings=data;
this.errorMsg="";
if(data){
}
else{
this.errorMsg="Nothing Found";
}
},
error =>{
console.log("error : "+error);
this.errorMsg="Error Loading Your Listings";
}
) ;
}
When there are some results from my backend (that are being sent in Json format) everything is ok. what i want is when the results are empty and i receive from the server this
[]
i want this.errorMsg to become Nothing Found. Any help would be appreciated ;) Thanks