title: Angular 2: Convert Observable to Promise
body: <p><strong>Q) How do I convert the following observable to a promise so I can call it with <code>.then(...)</code>?</strong></p>
  
  <p>My method I want to convert to a promise:</p>
  
  <pre><code>  this._APIService.getAssetTypes().subscribe(
      assettypes =&gt; {
          this._LocalStorageService.setAssetTypes(assettypes);
      },
      err =&gt; {
          this._LogService.error(JSON.stringify(err))
      },
      () =&gt; {}
    ); 
  </code></pre>
  
  <p>The service method it calls:</p>
  
  <pre><code>  getAssetTypes() {
      var method = "assettype";
      var url = this.apiBaseUrl + method;
  
      return this._http.get(url, {})
        .map(res =&gt; &lt;AssetType[]&gt;res.json())
        .map((assettypes) =&gt; {
          assettypes.forEach((assettypes) =&gt; {
            // do anything here you might need....
        });
        return assettypes;
      });      
    }  
  </code></pre>
  
  <p>Thanks!</p>