title: ''Promise' only refers to a type, but is being used as a value here
body: <p>I tried to use a promise to Async call in my custom validator in the form for that I created following separate typescript file</p>
  
  <p><strong>usernameValidators.ts</strong> </p>
  
  <pre><code>import { Control } from 'angular2/common';
  
  export class UsernameValidators {
  
      static shouldBeUnique(control: Control){
          return new Promise((resolve, reject) =&gt; {
              setTimeout(function(){
                  if(control.value == "mosh")
                      resolve({ shouldBeUnique: true });
  
                  else
                      resolve(null);
  
  
              }, 1000);
          });
      }
  }
  </code></pre>
  
  <p>I'm developing this using VS code, here I'm having red squiggly line under <strong>Promise</strong> and once I goto <strong>PROBLEMS</strong> tab, I can see </p>
  
  <p>following error</p>
  
  <p><a href="https://i.stack.imgur.com/5bMTp.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/5bMTp.png" alt="enter image description here"></a></p>
  
  <p>how to solve this issue.</p>