Like custom validators, async validators inherit from the same Validator class too; but this time, instead of returning an object map, async validators return a Promise.
Let's look at the definition of the validator. Copy the definition of the validator from the GitHub (http://bit.ly/ng6be-6-1-remote-validator-directive-ts) folder and add it to the shared module folder. The validator definition looks as follows:
import { Directive, Input } from '@angular/core';import { NG_ASYNC_VALIDATORS, FormControl } from '@angular/forms';@Directive({ selector: '[abeRemoteValidator][ngModel]', providers: [{ provide: NG_ASYNC_VALIDATORS, useExisting: RemoteValidatorDirective, multi: true }]})export class RemoteValidatorDirective ...