title: How to reject a promise on NativeScript - Angular 2
body: <p>I have a code that works in angular 2, but when I try to use it in a nativescript project fails. 
  I´m trying to reject a promise like this: </p>
  
  <pre><code>login(credentials:Credentials):Promise&lt;User&gt; {
      if (!valid) {
           return Promise.reject&lt;User&gt;("Invalid password");
      }else {
           return Promise.resolve(new User("some user"));
      }
  }
  </code></pre>
  
  <p>And I get this error: </p>
  
  <pre><code>Error:(32, 22) TS2346: Supplied parameters do not match any signature of call target.
  </code></pre>