Normally if I want a form field to be included in the submission but not visible I do an <input type="hidden" />
However, matInput
doesn't allow for a type of hidden
. I could use a display: none;
but that usually excludes the value from submission.
Is there a way to hide the input in a material dynamic form that also include the value in submission?
On your html code, disableEditSiteName() function result decides to disable or enable the input . So you can use that value for mat-hint . If disableEditSiteName() function returns true , you should hide mat-hint and if it returns false, you should show mat-hint .
<mat-form-field> is a component used to wrap several Angular Material components and apply common Text field styles such as the underline, floating label, and hint messages.
In angular 10, you can use *ngIf with <mat-form-field>
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With