amateur

Angular 5 reactive form set mat-checkbox to check

假如想象 提交于 2020-01-02 02:11:28
问题 I am trying to use mat-checkbox with reactive forms on Angular 5.1.2 and Angular Material 5.0.2. Everything is working well except that when I use patchValue({amateur: [false]) it is still checked. What is weird is I have other forms where I am doing the same thing and they work fine. It also isn't just the amateur checkbox, it is all the checkboxes are checked. Just using "amateur" as an example. The formControl amateur.value is always false. However once the patched value is executed, the

Angular 5 reactive form set mat-checkbox to check

依然范特西╮ 提交于 2019-12-05 04:55:03
I am trying to use mat-checkbox with reactive forms on Angular 5.1.2 and Angular Material 5.0.2. Everything is working well except that when I use patchValue({amateur: [false]) it is still checked. What is weird is I have other forms where I am doing the same thing and they work fine. It also isn't just the amateur checkbox, it is all the checkboxes are checked. Just using "amateur" as an example. The formControl amateur.value is always false. However once the patched value is executed, the control is checked. What am I missing? HTML5 <form [formGroup]="showClassGrp"> <mat-checkbox id="amateur