Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to hide material input

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?

like image 865
dcp3450 Avatar asked Feb 27 '19 22:02

dcp3450


People also ask

How do you hide a hint mat?

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 .

What is mat in angular?

<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.


1 Answers

In angular 10, you can use *ngIf with <mat-form-field>

like image 72
ikae Avatar answered Oct 12 '22 16:10

ikae