Just starting out with Angular and I could really use some guidance on how to implement an Angular Reactive Form that will generate the JSON result shown below:
{
"firstName":"",
"middleName":"",
"lastName":"",
"addressBook":[{
"addressLine1":"",
"addressLine2":"",
"addressLine3":""
},
"addressBook":[{
"addressLine1":"",
"addressLine2":"",
"addressLine3":""
}]
}
Here is the structure of the form I currently have:
this.userForm= this.fb.group({
firstName: [],
middleName: [],
lastName: [],
emailAddress: [],
password: [],
addressBook: this.fb.group({
addressLine1: [],
addressLine2: [],
addressLine3: []
})
});
I am struggling with this. Any assistance would be greatly appreciated. Thank you!