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

157
Views
Angular FormGroup tocado no funciona para la casilla de verificación

La forma angular para verificar la forma se toca y no funciona con la casilla de verificación. !newDeviceGroup.touched = true a pesar de que la casilla de verificación cambia su valor cuando hago clic. ¿No estás seguro de por qué?

 <form [formGroup]="newDeviceGroup" (ngSubmit)="onSubmit()"> <div class="row"> <div class="col"> <label class="chk-container" for="isNewDevice" ><span class="chk-label">Device is work</span> <input type="checkbox" id="isNewDevice" name="isNewDevice" class="isNewDevice" [value]="isDeviceWork" [checked]="isDeviceWork == true" (change)="onCheckChange($event)" /> <span class="checkmark"></span> </label> </div> </div> <button type="submit" class="btn btn-primary" id="btnSubmit" [disabled]="!newDeviceGroup.touched"> </form>
about 4 years ago · Juan Pablo Isaza
1 answers
Answer question

0

Debe configurar FormGroup como tocado a través de AbstractControl.markAsTouched() .

 onCheckChange(event: any) { this.newDeviceGroup.markAsTouched(); }

Muestra de demostración en StackBlitz

about 4 years ago · Juan Pablo Isaza 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!