feat(mat-form-field): Support nested content projection for _formFieldControl #31196
Labels
feature
This issue represents a new feature or feature request rather than a bug or bug fix
needs triage
This issue needs to be triaged by the team
Feature Description
Allow the MatFormFieldControl within the mat-form-field component to be accessed through nested content projection
Use Case
I have a use case where I'm attempting to write a component that wraps mat-form-field for the purpose of "easier" error configuration, allowing devs to pass a
{ key: string, message: string }[]
to my component. I have a simple StackBlitz showing what currently "works" and how I'd like it to work: https://stackblitz.com/edit/components-issue-starter-yqzq6dje?file=src%2Fcustom-form-field-wrap.ts. Basically, I think if you were to add{ descendants: true }
to the definition of_formFieldControl
inmat-form-field
it would allow my use case. Although, I'm not sure what other, if any, repercussions of that change would be.The text was updated successfully, but these errors were encountered: