如何在angular2中触发表单验证器?
问题描述:
我已经创建了angular2 Web应用程序.因为我已经实现了一个带有表单生成器的自定义验证器,它将可以在提交时使用,但是我需要在其他表单控件值更改中动态触发验证,请任何人提出实现此建议的
I have created angular2 web application .in that i have implemented a custom validator with form builder it will work on submit but i need to trigger validation dynamically in other form control value change please any one give suggestion to achieve this
谢谢
答
尝试一下
this.RegisterForm1.controls["form control name"].updateValueAndValidity();
我认为可能会对您有所帮助
i think may be help you