title: ERROR TypeError: subscribe is not a function
body: <p>I am trying to get value from array based on some element and then getting the exact matching element. But somehow i am facing this error for in this function getProduct(name1: string), i have imported map already. Help will be much appreciated.
  this.searchProduct(...).subscribe is not a function</p>
  
  <pre><code> products: Product[] = [];
   product: Product;
  
   searchProduct(name2: string): Observable&lt;Product[]&gt; {
      var config = {
          headers: {
              'Content-Type': 'application/json'
          }
      };
      const ans = name2;
      let obj = { name_product: ans }
      let body = JSON.stringify(obj);
      let header = new HttpHeaders();
      header = header.append('Content-Type','application/json');
      return this.httpClient.post('postRestService', body, config).subscribe(res =&gt; {
          this.products = res;
          console.log(this.products);
      })
   }
  
    getProduct(name1: string): Observable&lt;Product&gt; {
     return this.searchProduct(name1).subscribe(products =&gt; 
     products.find(product =&gt; product.name1 == name1));
   }
  </code></pre>