question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Support async ErrorStateMatcher

See original GitHub issue

Please 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:open
  • Created 5 years ago
  • Reactions:7
  • Comments:5 (3 by maintainers)

github_iconTop GitHub Comments

1reaction
nicoabiecommented, Apr 19, 2020

@srcdes @crisbeto wouldn’t an async validator solve this issue? After an async validator runs ErrorStateMatcher is called

1reaction
manklucommented, Mar 12, 2019

but changing the return type will be a breaking change

@crisbeto Not if you keep the boolean as possible return type.

Read more comments on GitHub >

github_iconTop 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 >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found