An issue has arisen: No value accessor for form control with name: 'sNo'
It seems that formControlName cannot be found in my DOM
On the component side:
this.form = new FormGroup({
'sNo': new FormControl,
'question': new FormControl,
'options': new FormGroup({
'op': new FormControl,
})
});
On the HTML side:
<form [formGroup]="form">
<div *ngFor="let data of currentQuestionsValue">
<div *ngFor="let d of data.items ">
<strong formControlName="sNo"> {{ d.sno }}). </strong>
<span formControlName="question">{{ d.question}}</span>
<div>
<form formGroupName="options">
<label *ngFor="let key of objectKeys(d.options)" formControlName="op">
<input type="radio" name="option" [value]="d.options[key]">
<span>{{ d.options[key] }}</span>
</label>
</form>
</div>
</div>
</div>
</form>