To achieve this we are going to use token injection mat form field default options to set the default form field appearance.
Mat form field width.
First let s define our appearance constant of type matformfielddefaultoptions which will contain default appearance.
300px textarea matinput rows 5 cols 40 placeholder text textarea mat form field.
Import formsmodule reactiveformsmodule from angular forms.
We have implemented angular material form validation in couple of steps and now we can check the result.
Following angular component can be used within mat form field.
I cannot use bootstrap way to specify width with selectors like col xs 14 on components because it has the same level of specificity.
Bug feature request or proposal.
I suppose the width is included in stylesurl in mat form field component instead of in the mixin.
Josephperrott assigned jelbourn nov 2 2018 copy link quote reply.
Also works vega sep 30 17 at 12 38 1 vega.
Register the above modules to ngmodule imports.
Adding dialogs and shared module.
Import matinputmodule from angular material input.
Ng deep mat form field width 100 important.
The mat form field an angular directive is used to create a wrapper over angular components and is used to apply text styles like underline bold hints etc.
The current solution with defined width on mat form field class makes it harder to style components.
Input matnativecontrol textarea matnativecontrol select matnativecontrol mat select mat chip list.
Therefore for increasing width we have to use the css width property on a mat form field containing our textarea.
3 1.
In our case we will be setting our form field appearance as outline.