I am trying to merge two javascript sets into one. I am trying to put the products javascript object into the Quotes attribute of the solution object. So the end result should be the SolutionProducts object.
$scope.Products = {
"id":"",
"attributes":{
"term":"36"
},
"groups":[
{
"products":[
// list of products
]
}
]
}
$scope.Solution = {
"SolutionID":"",
"Quotes":[
]
}
$scope.SolutionProducts = {
"SolutionID":"",
"Quotes":[
{
"id":"",
"attributes":{
"term":"36"
},
"groups":[
{
"products":[
// list of products
]
}
]
}
]
}
I tried to use the push function but it didn't work
$scope.SolutionProducts = $scope.Solution.Quotes[0].push($scope.Products.products);
Array.prototype.pushis not the new array, but the number of elements.