bug(ErrorStateMatcher): Not able to configure globally ErrorStateMatcher
- Langage dominant
- TypeScript
- Étoiles
- 25k
- Forks
- 6.8k
- Merge moyen
- 1 j 8 h
- PR mergées (30 j)
- 91
Description
#### Reproduction
StackBlitz link for reproduction: https://stackblitz.com/edit/components-issue-enshvf
Steps to reproduce:
1. Pay your attention that CoreModule has declaration for `ErrorStateMatcher` provider with class `ShowOnDirtyErrorStateMatcher`. CoreModule imported into AppModule in the same way as FeatureModule.
2. Try to focus/blur example "Favorite Food" input and note that `ShowOnDirtyErrorStateMatcher` was not applied.
In big enterprise applications we should have clean modular structure without any SharedModule or MaterialModule to be imported into each feature module.
MatInputModule has hardcoded `ErrorStateMatcher` provider and when we import that module into our feature modules – our global `ErrorStateMatcher` provider is overwritten.
I suppose this issue related with PR #18962, but I believe this issue describes another problem with `ErrorStateMatcher`
#### Expected Behavior
ErrorStateMatcher can be defined globally
#### Actual Behavior
ErrorStateMatcher overwrites with each MatInputModule import
#### Environment
- Angular: 9+
- CDK/Material: 9+
Guide de contribution
Ouvrir le guide de contribution
Piste de recherche
Commencez par la reproduction StackBlitz liée et suivez la manière dont ErrorStateMatcher est fourni par CoreModule, FeatureModule et MatInputModule. Vérifiez le comportement du provider lorsque MatInputModule est importé dans plusieurs modules de fonctionnalités ; la tâche est terminée lorsqu’un ErrorStateMatcher configuré globalement reste effectif et que le champ de saisie Favorite Food de la reproduction l’utilise.
Rédigé par le modèle d'indexation à partir du texte de l'issue.
Évaluation
- Stack technique
- angular, typescript
- Domaine
- frontend
- Type d'issue
- Bug
- Difficulté
- 4/5
- Temps estimé
- 3-5 jours
- Activité
- À l'abandon
- Clarté
- Plutôt claire
- Accessibilité débutants
- 48/100