title: How to return a proper Promise with TypeScript
body: <p>So I am learning Angular 2 with typescript.</p>
  
  <p>I am reaching a point to write a mocking service which (I believe) should return a Promise if the service get the Object Successfully and Return an Error if anything happens.</p>
  
  <p>I have tried following code but looks like it is not a write syntax for typescript.</p>
  
  <p>Updated the CODE:</p>
  
  <pre><code>saveMyClass(updatedMyClass: MyClass){
          //saving MyClass using http service
          //return the saved MyClass or error
          var savedMyClass : MyClass = someLogicThatReturnsTheSavedObject(updatedMyClass);
          if(isSomeCondition)
              return Promise.reject(new Error('No reason but to reject'));
          else
              return new Promise&lt;MyClass&gt;(resolve =&gt; {setTimeout( ()=&gt;resolve(savedMyClass),1500  )}  );
      }
  </code></pre>
  
  <p>But to my surprise, the typescript complained that "No best common type exists among return expressions".</p>
  
  <p>What should be the right code? So that I could use on my component to consume if proper MyClass is returned and reflect error if any exists from service.</p>
  
  <p>Thanks</p>