title: Immediately resolved Observable - equivalent of $q.when()
body: <p>While doing my first Angular 2 CRUD exercise, I am trying to re-use my edit form to both add new and edit an existing object.</p>
  
  <p>I am having this improper code:</p>
  
  <pre><code>this._route.params.forEach((params: Params) =&gt; {
        let id = params['id'];
        if (id) {
          this._productService.getProduct(id)
            .subscribe(
              product =&gt; this.product = product,
              error =&gt; this.errorMessage = &lt;any&gt;error
            );
        } else {
          this.product = {
            name: 'default name',
            ean: '',
            price: 0,
            qty: 0,
            imageUrl: '',
            _id: ''
          };
        }
  
      });
  
      (&lt;FormGroup&gt;this.registerForm).setValue(this.product, {onlySelf: true});
  </code></pre>
  
  <p>... which no wonder does not work - because one part of the <code>if</code> is sync, the other - async.</p>
  
  <p>I want to optimize the code and convert the static default object template into a value from an immediately resolved Observable - basically an equivalent of <code>$q.when(myVar)</code>. How do I do that?</p>