I have json file that has array of organizations and each organization object has its properties and array of regions as well. I am building reactive angular form with pre-populated values in it as shown below.
public createForm() {
this.editForm = this.fb.group({
organizations: this.fb.array(
[this.buildOrganization('text')]
)
});
}
buildOrganization(name: String) {
return new FormGroup({
organizationTitle: new FormControl(name),
regions: this.fb.array(
[this.buildRegion()]
)
})
}
buildRegion() {
return new FormGroup({
regionTitle: new FormControl(''),
})
}
I am trying to add one static value "text", but lets say I have an array of organizations, how can I pre-populate this form?
screen shot of example json format. Here I only need description from both organization(s) and region(s) object(s)
