Suppose my JSON is:
{
"todo" : "Dinner",
"user" : [
{
"name" : "",
"password" : ""
}
],
"notes : "some notes"
}
And I want to formulate the object from that JSON.
So in angularjs, first I can do the following to formulate the user array:
userArray = [{
name: 'myname',
password: 'password'
}];
And my object without userArray is as follows:
var object = {};
object.todo = "Dinner";
object.notes = "some notes";
Now how to add userArray
to this object
to get the complete object?