Both mat-error show when only one condition is true

前端 未结 2 1780
栀梦
栀梦 2021-01-16 09:08

Both mat-error show when only one error appeared.

I\'m trying to make custom validators with mat-error. Both input for email and confirm password are red when each

2条回答
  •  无人及你
    2021-01-16 09:52

    The email address field shows an error because the error state matcher checks the parent - which is the form - which is in error because the password fields do not match. You need to use different error state matchers for the email field and password fields because the conditions are different - email does not need to be in error if the password fields don't match.

提交回复
热议问题