NetanelBasal
10/24/2016 - 10:01 PM

async4.ts

validateUniqueEmailPromise( email : string ) {
    return new Promise(resolve => {
      setTimeout(() => {
        if( email === "alreadyExistsEmail@gmail.com" ) {
          resolve({
            asyncInvalid: true
          })
        } else {
          resolve(null);
        }
      }, 2000);
    })
}