当尝试添加确认邮件功能组时出现错误 Expected 1-2 arguments but got 3.ts(2554)?

when try to add confirm mail function group get error Expected 1-2 arguments but got 3. ts(2554)?

问题

error 预期有 1-2 个参数,但在添加确认电子邮件作为第三个参数时得到 3.ts(2554)?

我在 angular 7 我制作了注册用户表单

何时进行验证比较用户邮件以确认 Reactive 表单上的邮件。

函数组不接受为邮件确认添加参数,如下代码

so 如何在注册表单上添加确认电子邮件?

import {MustMatchEmail} from '../helpers/EmailValidator';
import {MustMatch} from '../helpers/must-match.validator';
constructor() {}
UserMail = new FormControl('', [Validators.required, Validators.email, Validators.pattern('^[a-z0-9._%+-]+@[a-z0-9.-]+\.[a-z]{2,4}$'), Validators.maxLength(100)]);

ConfirmedEmail = new FormControl('', [Validators.required, Validators.email, Validators.maxLength(100)])

ngOnInit() {
  this.createFormValidations();
}
createFormValidations() {
  this.registerForm = this.formBuilder.group({
      UserMail: this.UserMail,
      ConfirmedEmail: this.ConfirmedEmail,
      UserPass: this.UserPass,
      ConfirmedPassword: this.ConfirmedPassword,

    }, {
      validator: MustMatch('UserPass', 'ConfirmedPassword')
    },
    //here error function not accept mail confirm
    {
      validator: MustMatchEmail('UserMail', 'ConfirmedEmail')
    }
  );
}

试试这个:参考:https://alligator.io/angular/reactive-forms-custom-validator/

this.registerForm = this.formBuilder.group({
      userMail: [this.userMail, MustMatchEmail('UserMail','ConfirmedMail')],
});