Angular2: email already exist as custom Validator?
问题 I created a form with Angular2 and I created the following method to check if the email address already exist. Here is my code: checkEmail(): void { // FIRST PART this.found = false; // If user is not Premium... if (!this.currentUser.isPremium) { // ...and if user typed something in the input field, then apply validitor for email address if (this.myForm.controls.email.value.length > 0) { this.myForm.controls.email.setValidators([validateEmail()]); this.myForm.controls.email