How to implement Custom Async Validator in Angular2/4/5
<p><strong>1.</strong> Is it even supported by Angular yet ? see <a href="https://github.com/angular/angular/issues/1068" rel="noreferrer">this</a> open issue</p>

<p><strong>2.</strong> If it is, then what is wrong in the code below</p>

<pre><code>export class someClass{

    myForm:ControlGroup;

    constructor(public http:Http, public formBuilder:FormBuilder)
       this.myForm = formBuilder.group({
            ImageId: ["", Validators.required, this.asynValidator]
    });

    asyncValidator(control: Control): {[key: string]: any} {

        return new Promise (resolve =&gt; {

          let headers = new Headers();
          headers.append('Content-Type', 'application/json');

          this.http.get('http://localhost/ImageIdValidate?id='+ control.value, {headers:headers})
                .map(res =&gt; res.json())
                .subscribe(data =&gt; {
                    console.log(data);
                    if(data != null) {
                        resolve({"duplicate": true})
                    }
                    else resolve(null);      
                })
            });
        });
      }
    }
</code></pre>

<p>It doesn't even make a server request.</p>