【发布时间】:2018-05-23 22:29:59
【问题描述】:
我正在尝试向自定义表单验证器发送值:
this.myForm = this.fb.group({
Id: [null],
Password: ['', [Validators.required]],
PasswordConfirm: ['', Validators.compose([CustomValidators.expectedMatchingFields(this.myForm.controls.Password.value), Validators.required])]
});
但它不喜欢我发送"this.myForm.controls.Password.value"。还有其他方法吗?
说"Cannot read property 'controls' of undefined"会出错。
【问题讨论】:
-
“不喜欢我发送”是什么意思?有没有报错?
-
您能否提供更多信息,例如什么错误或验证器是如何实现的?
标签: angular