title: Angular 2.0 - converting promise chaining to Observables
body: <p>I am converting an NG 1.X service to NG 2.0. </p>
  
  <p>My NG 1.X service has promise chaining (simplified):</p>
  
  <pre><code>dataService.search = function(searchExp) {
        return this.getAccessToken()
        .then(function(accesstoken) {
          var url = $interpolate('https://my-api-url?q={{search}}&amp;{{accesstoken}}')({search: searchExp, accesstoken: accesstoken});
          return $http({
            url: url,
            method: 'GET',
            cache: true
          });
        }).then(function(response) {
          return response.data;
        });
      };
  </code></pre>
  
  <p>I want to convert <code>search</code> service to be an Angular 2.0 Service, using <code>http</code> and returning <code>Observable</code>. I prefer leaving the <code>getAccessToken</code> service untouched, as an NG 1.X service, which returns a promise.</p>
  
  <p>I was thinking about using <code>Observable.fromPromise</code> on the old "promise" service. </p>
  
  <p>How can I do it? How can I chain those two?</p>
  
  <p><strong>EDIT</strong>:</p>
  
  <p>Just to clarify, I want it to be something like this:</p>
  
  <pre><code>dataService.search = function(searchExp) {
   return this.getAccessToken()
          .then(function(accesstoken) {
             //Here I want to use:
             // this.http.get(url).subscribe(() =&gt; ...)
            });
          };
  </code></pre>