Support async ErrorStateMatcher
See original GitHub issuePlease describe the feature you would like to request.
Currently, ErrorStateMatcher
doesn’t support return type Promise
and Observable
. Its return type is only boolean
.
What is the use-case or motivation for this proposal?
I need to show <mat-error>
when checked input
is invalid after validation. This validation does need to call HTTP request(async). For example, when ID field in registration form is not unique, i should show <mat-error>
because registration form doesn’t allow to use the input’s value as duplicated ID with other user. To provide this feature, ErrorStateMatcher
has to support return type as Promise
or Observable
.
Issue Analytics
- State:
- Created 5 years ago
- Reactions:7
- Comments:5 (3 by maintainers)
Top Results From Across the Web
Support async ErrorStateMatcher · Issue #15453 - GitHub
I need to show <mat-error> when checked input is invalid after validation. This validation does need to call HTTP request(async). For example, ...
Read more >Async validator and mat-autocomplete not working together
In the validate function I do a request to the api to check if the data validates and that works fine. But if...
Read more >MatError & Cross-Field Validators In Angular Material 7 - ITNEXT
An ErrorStateMatcher is a class that defines for the form-field when to display error messages. It's simple to create one. It will enforce...
Read more >Select | Angular Material
errorStateMatcher : ErrorStateMatcher. Object used to control when error messages are shown. @Input(). id: string. Unique id of the element. @Input().
Read more >Chapter 11. Validating forms - Angular Development with ...
... Creating custom validators; Handling sync and async validation; ... In this section, we'll look at a number of other properties that help...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
@srcdes @crisbeto wouldn’t an async validator solve this issue? After an async validator runs
ErrorStateMatcher
is called@crisbeto Not if you keep the boolean as possible return type.