How to trigger Angular 2 input validation manually?

后端 未结 3 1399
萌比男神i
萌比男神i 2021-02-01 13:06

I have two inputs: - First one on which I apply my custom validator - Second one which value I use in my custom validator (it is dynamic and editable)

If I apply my cust

3条回答
  •  眼角桃花
    2021-02-01 13:41

    You can update the validity of a formControl

    form.controls['myControl'].updateValueAndValidity();

提交回复
热议问题