Answer the question
In order to leave comments, you need to log in
Cannot read property 'required' of null for radio button?
There is this code:
<ng-container *ngIf="fieldDefinition.fieldtype == 'radio'">
<div class="col-md-12">
<label>{{ fieldDefinition.title }}</label>
<ng-container *ngFor="let radio of fieldDefinition?.datasource?.value">
<div class="form-check form-check-radio">
<label class="form-check-label">
<input
class="form-check-input"
type="radio"
name="radio_{{ id }}"
#ref="ngModel"
id="{{ id }}"
(change)="handleRadioChange(fieldDefinition)"
[checked]="radio.id == fieldDefinition.fieldvalue"
[value]="radio.id"
[(ngModel)]="fieldDefinition.fieldvalue"
/>
{{ radio.value }}
<span class="circle">
<span class="check"></span>
</span>
</label>
</div>
<div *ngIf="ref.errors.required">Поле обязательно для заполнения</div>
</ng-container>
</div>
</ng-container>
Cannot read property 'required'
Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question