I have a json file structured as follows:
{
"users": [
{
"id": "person1",
"information": [
{
"first_name": "Mike",
"last_name": "Patty",
"address": ["address1","address2"]
},
{
"first_name": "Mike2",
"last_name": "Patty2",
"address": ["address1","address2"]
}
]
},
{
"id": "person2",
"information": [
{
"first_name": "Tom",
"last_name": "Jerry",
"address": ["address1","address2"]
},
{
"first_name": "Tom2",
"last_name": "Jerry2",
"address": ["address1","address2"]
}
]
}
]
}
My goal is to loop through each user's data and input it into the API database using the addInfo
request. This request needs the fields: first_name
, last_name
, and address
(an array). This is necessary in order to store the response from the information request for future reference.. I am relatively new to working with angular/typescript, so here is my attempt at coding this so far:
Thank you very much!