Access 'this' Inside Promise
<p>In the typescript function below, 'this' doesn't resolve to the instance of EmailValidator. How can I correct this function so it resolves to the correct instance of EmailVaildator and in turn, so that I can access _registerServices?</p>

<pre><code>class EmailValidator {

    constructor(private _registerServices: RegisterServices) { }

    isAvailable(c: AbstractControl): Promise&lt;ValidationResult&gt; {
        let q = new Promise((resolve, reject) =&gt; {
            this._registerServices.emailIsAvailable(antiForgeryToken(), c.value)
                .then(result =&gt; {
                    // Need to actually check the result.
                    resolve({ "emailtaken": true })
                },
                error =&gt; {
                    // Need to communicate the server error? Probably not.
                    resolve({ "servererror": true })
                });
        });

        return q;
    }
}
</code></pre>