I have the following Json I want to POST.
{
"team": {
"id": "1",
"teamName": "TeamName",
},
"location": {
"id": "1",
"name": "LocationName",
},
"duration": 60
"dateTime": 949417200000,
}
In my AnguarJS controller I need to accept the form data and create this json dynamically to POST to a web service.
I can get it to work fin without nested json, but not when as above.
var team = {
"id": "1",
"teamName": "TeamName",
};
var location = {
"id": "1",
"name": "Name",
};
var entry = {
"duration": "40",
"dateTime": "949417200000",
"team": + "\"{" + team + "}\"",
"location": + "\"{" + location + "}\""
};
Team and Location are null when converted as follows;
console.log(angular.toJson(entry));
.."team": + [team]..supposed to do? Inspectentryinconsole.dir/logto see "the problem".