Support async ErrorStateMatcher
- Dominant language
- TypeScript
- Stars
- 25k
- Forks
- 6.8k
- Avg merge
- 1d 8h
- Merged PRs (30d)
- 91
Description
#### 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 `` 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 `` 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`.
Contributor guide
Research direction
Start by reading the ErrorStateMatcher API and the existing mat-error validation flow, focusing on how the input's validity is checked. Compare the requested Promise and Observable cases, then define completion as async validation results reliably causing the appropriate mat-error state for duplicate IDs.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- angular, typescript
- Domain
- frontend
- Issue type
- Feature
- Difficulty
- 5/5
- Estimated time
- Over a week
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 25/100