I'm wondering what is the best way of copying object property's from/to another object using AngularJS/JavaScript
Below is the Json object I'm getting:
{
"application":{
"number":"323-23-4231",
"amount":"234.44",
"ref_name":"Thomas Edison"
},
"borrower":{
"prefix":"Mr",
"first_name":"Eric",
"middle_name":"E",
"last_name":"Schulz",
"date_of_birth":"09/29/1975",
"email_address":"myemail@HOTMAIL.COM",
"phones":[
{
"number":"(555)555-5555",
"type":"Mobile"
}
]
}
}
Using the above Json object I want the new JSON object data to be looks like this:
{
"number":"323-23-4231",
"amount":"234.44",
"ref_name":"Thomas Edison",
"prefix":"Mr",
"first_name":"Eric",
"middle_name":"E",
"last_name":"Schulz",
"date_of_birth":"09/29/1975",
"email_address":"myemail@HOTMAIL.COM",
"phones":[
{
"number":"(555)555-5555",
"type":"Mobile"
}
]
}