Custom error state matcher that additionally checks for validity of interacted form.
(control: AbstractControl | null, form: FormGroupDirective | NgForm | null)
| 104 | |
| 105 | /** Custom error state matcher that additionally checks for validity of interacted form. */ |
| 106 | isErrorState(control: AbstractControl | null, form: FormGroupDirective | NgForm | null): boolean { |
| 107 | const originalErrorState = this._errorStateMatcher.isErrorState(control, form); |
| 108 | |
| 109 | // Custom error state checks for the validity of form that is not submitted or touched |
| 110 | // since user can trigger a form change by calling for another step without directly |
| 111 | // interacting with the current form. |
| 112 | const customErrorState = !!(control && control.invalid && this.interacted); |
| 113 | |
| 114 | return originalErrorState || customErrorState; |
| 115 | } |
| 116 | |
| 117 | isSignalErrorState(field: Field<unknown> | null): boolean { |
| 118 | const originalErrorState = this._errorStateMatcher.isSignalErrorState?.(field) ?? false; |
nothing calls this directly
no outgoing calls
no test coverage detected