title: Angular how to display a message if data from api is 0 or empty
body: <p>I have a get request from an api, called in as a service into my component, I would like to display a message if the data result is 0 or empty.</p>
  
  <p><strong>Component.ts</strong></p>
  
  <pre><code> public errorApi = false;
  
  
   ngOnInit() {
      this.service.getIncidents(this.customer_id).subscribe((data) =&gt; {
        this.loading = true;
        this.data = data.result;
        this.loading = false;
        console.log('Result - ', data);
        console.log('data is received');
      })
      }
  }
  </code></pre>
  
  <p><strong>Service.ts</strong></p>
  
  <pre><code>  getIn(customerId): Observable&lt;any&gt; {
      return this.http.get&lt;any&gt;(this.serviceApiUrl + "?customer_id=" + customerId)
        .pipe(
          catchError(this.handleError)
        );
    }
  </code></pre>
  
  <p><strong>html ngif</strong></p>
  
  <pre><code>      &lt;ng-container *ngIf="errorApi"&gt;
          &lt;div class="column col-12 text-center pt-10 pb-10"&gt;
            &lt;div class=""&gt;Error nothing loaded&lt;/div&gt;
          &lt;/div&gt;
        &lt;/ng-container&gt;
  </code></pre>