MCPcopy Create free account
hub / github.com/angular/components / isErrorState

Method isErrorState

src/material/stepper/stepper.ts:106–115  ·  view source on GitHub ↗

Custom error state matcher that additionally checks for validity of interacted form.

(control: AbstractControl | null, form: FormGroupDirective | NgForm | null)

Source from the content-addressed store, hash-verified

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;

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected