Is there a way to save JSON data along with Angular reactive form in the FormControl?
For instance:
JSON received from the server = [{
ctrlname : controlName1,
type : "Link",
unit:"M"
},{
ctrlname : controlName2,
type : "Date",
unit:"L"
}]
// Creating FormGroup
let a = new formGroup({
controlName1 : new FormControl(''),
controlName2 : new FormControl(''),
})
I would like to include type, unit properties within the formControl. How can I achieve this while creating form group with formControl?
If I retrieve the value of formControl like this: myFormGroup.controls['controlName1'], how can I also get the unit and type values? What is the method to store unit and type JSON during the creation of formControl?