docs-feat(forms): Add guide on how to create custom components from existing material components #21371
Labels
Comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment


Documentation Feedback
Even though I am an Angular veteran I find myself struggling every time I want to create a custom material component.
I would like to see more guides / tutorials on how to wrap existing form field components such as matInput and mat-select.
Wrap a matInput or mat-select
I need to have a mat-select with some pre defined options that I reuse through out my application.
I would simply want to relay everything from my component to the underlying
mat-selectthis should pass both value, changes, validation to the underlying
mat-selectand since you most of the time also have a
mat-form-fieldit should also work in this contextWrap a auto complete or mat-select with async data fetching
This is very similar to the one above but because of its async nature it's more complex to get it right with how to best setup the data fetching, form merging and validation to work properly.
The nature of this kind of custom input is often to auto complete or fetch a list of existing database items and be able to choose from them.
The guide could have a reactive service as a backing service for the picker
and the output to the projectManager field could be their User ID.
Summary
The more guides we have for common use cases the more people would visit the docs.
It doesn't matter if the guide doesn't match my need exactly. It should just guide you in the right direction regarding how to connect all the docs with:
Ps. I would happily help to contribute if we first can discuss what the best solutions are for the above.
Examples
The text was updated successfully, but these errors were encountered: