Is there any way to control visibility of controls using FormGroup (TypeScript Angular 2).
I'm manage to write the following code:
this.myDoch.controls['text1'].disable();
but it only blocked the control, I'm looking for hide the contorl.
Thanks.
You can use disabled
like this:
<input [ngClass]="{'hidden': link.controls.title.disabled}" type="text" formControlName="title" />
linkArry.controls[0].disable();
.hidden {display:none;}
You can use the 'disabled' css selector. For example :
.my-input:disabled {
display:none;
}
You can read about it here.
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