@@ -30,6 +30,10 @@ be used with `matNativeControl`:
3030* url
3131* week
3232
33+ ### Use with Angular Forms
34+
35+ ` matInput ` is compatible with ` @angular/forms ` and supports ` FormField ` , ` FormsModule ` , and ` ReactiveFormsModule ` .
36+
3337### Form field features
3438
3539There are a number of ` <mat-form-field> ` features that can be used with any ` <input matNativeControl> ` or
@@ -53,11 +57,20 @@ with your `matNativeControl`. By default, these error messages are shown when th
5357the user has interacted with (touched) the element or the parent form has been submitted. If
5458you wish to override this behavior (e.g. to show the error as soon as the invalid control is dirty
5559or when a parent form group is invalid), you can use the ` errorStateMatcher ` property of the
56- ` matNativeControl ` . The property takes an instance of an ` ErrorStateMatcher ` object. An ` ErrorStateMatcher `
60+ ` matNativeControl ` . The property takes an instance of an ` ErrorStateMatcher ` object.
61+
62+ For reactive forms, an ` ErrorStateMatcher `
5763must implement a single method ` isErrorState ` which takes the ` FormControl ` for this ` matNativeControl ` as
5864well as the parent form and returns a boolean indicating whether errors should be shown. (` true `
5965indicating that they should be shown, and ` false ` indicating that they should not.)
6066
67+ For signal forms, an ` ErrorStateMatcher `
68+ must still implement the method ` isErrorState ` for backwards compatability with the reactive forms API,
69+ but it can be fullfilled with ` isErrorState() {return false} ` .
70+ Then the custom matcher can implement ` isSignalErrorState ` , which takes the ` Field ` for this
71+ ` matNativeControl ` as well as the parent form and returns a boolean indicating whether errors
72+ should be shown. (` true ` indicating that they should be shown, and ` false ` indicating that they should not.)
73+
6174<!-- example(input-error-state-matcher) -->
6275
6376A global error state matcher can be specified by setting the ` ErrorStateMatcher ` provider. This
0 commit comments