title: Can you return an observable as a promise in Angular 2 (Using Typescript)?
body: <p>I am learning to develop in Ionic 2 using Angular 2 and Typescript.</p>
  
  <p>What I am immediately trying to is create a function that returns a promise that gets resolved when an observed variable changes. </p>
  
  <p>This would be useful for me to detect when initialisation within a provider has been completed before page components attempt to use it. e.g.</p>
  
  <pre><code>api.isInitialized()
      .then(() =&gt; {
          //api provider is initialized. Now safe to call it!
          return api.fetch("NEWS");
      });
      .then((newsData) =&gt; {
          //do something with newsData
      });
  </code></pre>
  
  <p>I have the following imports:</p>
  
  <pre><code>import 'rxjs/add/operator/map';
  import 'rxjs/add/operator/toPromise';
  import { Observable} from 'rxjs/Observable';
  </code></pre>
  
  <p>Just to check my understanding of how toPromise would work I tried calling the following function. I only get "testObservable has changed". 
  I was hoping to also get "promise resolved".</p>
  
  <p>How would I get a change to testObservable to result in a resolved promise? </p>
  
  <pre><code> observerTest(){
      let testObservable: any;
      let testObserver: any;
  
      testObservable = Observable.create(observer =&gt; {
          testObserver = observer;
      });
  
      let myPromise = testObservable.toPromise();
  
      testObservable.subscribe(data =&gt; {
          console.log("testObservable has changed.");
          console.log(data);
      });
  
      myPromise.then(() =&gt;{
          console.log("promise resolved.");
      });
  
      testObserver.next(true);
  }
  </code></pre>