Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

229
Views
Angular 2 -> how to hide controls using FormGroup

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.

about 4 years ago · Santiago Trujillo
2 answers
Answer question

0

You can use disabled like this:

HTML

<input [ngClass]="{'hidden': link.controls.title.disabled}" type="text" formControlName="title" />

component.ts

linkArry.controls[0].disable();

CSS

.hidden {display:none;}

about 4 years ago · Santiago Trujillo Report

0

You can use the 'disabled' css selector. For example :

.my-input:disabled {
    display:none;
}

You can read about it here.

about 4 years ago · Santiago Trujillo Report
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!