I have created a FormGroup and initialized it with one formControlName called SerialNumber
.
The JSON structure for SerialNumber is as follows:
{
"SerialNumber": {
"snValue": "332432"
}
}
I am struggling to bind the value of SerialNumber.snValue
to the <input>
. Instead of displaying 332432
, I keep getting [object Object]
.
.ts code snippet
equipmentForm: FormGroup;
constructor(private fb: FormBuilder) {}
ngOnInit(): void {
this.equipmentForm = this.fb.group({
serialNumber: {"snValue": "332432"}
})
}
.html snippet
<input type="text" formControlName="serialNumber" />
My main question is, how can I properly bind snValue
in this scenario?