0

I use single reactive form as insert and update operation in both case radio button needed to be checked - how can I fix this issue?

Here is the field I use

    <div class="form-group">
        <div class="col-sm-6">
             <div class="row">
                <div class="col-sm-6">
                      <input type="radio" formControlName="reportheader" id="reportheader0" [value]="0" (change)="isRhChanged()" [(ngModel)]="reportSettingData?.header_option"> According to present format
                </div>
                <div class="col-sm-6">
                      <input type="radio" formControlName="reportheader" id="reportheader1" [value]="1" (change)="isRhChanged()" [(ngModel)]="reportSettingData?.header_option"> Will use a customized header
                </div>
             </div>
          </div>
        </div>
     </div>

Error:

Parser Error: The '?.' operator cannot be used in the assignment at column 34

For the default value to be checked, I use this code in the component:

this.rForm.patchValue({ reportheader: '0' });
Kishan Sanghani
  • 279
  • 3
  • 14

0 Answers0