title: Angular 8: Get values without subscription to an observable
body: <p>These are the two methods that I need to subscribe to in various parts of my application:</p>
  
  <pre><code>  getProducts(): Observable&lt;Product[]&gt; {
      return this.http.get&lt;Product[]&gt;(this.url);
  }
  
    getProductsByIds(ids: number[]): Observable&lt;Products[]&gt; {
      return this.getProducts()
        .map(products =&gt; products.filter(products =&gt; ids.includes(product.id)));
  }
  </code></pre>
  
  <p>This works fine for most of my compoments, but in one component, I know the<code>id</code>-s beforehand and just want to display 4 products with id-s 1, 2, 9, 18. I want to call the method like so: <code>getProductsByIds([1, 2, 9, 18])</code>). I only know how to subscribe to these two observables, but how can I just get these 4 products once and for all (without the need for a stream of values)? I must have missed some basic lecture..</p>