title: Angular 2 (TypeScript) Handle empty json Response from Http
body: <p>i have this function </p>
  
  <pre><code>searching() {
   this._demoService.postData(this.url,this.searchtobesent).subscribe(
    data =&gt;{
      this.listings=data;
      this.errorMsg="";
      if(data){
      }
      else{
        this.errorMsg="Nothing Found";
      }
    },
    error =&gt;{
      console.log("error : "+error);
      this.errorMsg="Error Loading Your Listings";
    }
    ) ;
  }
  </code></pre>
  
  <p>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</p>
  
  <pre><code>[]
  </code></pre>
  
  <p>i want this.errorMsg to become Nothing Found.
  Any help would be appreciated ;)
  Thanks</p>