6
I’m putting together a shopping cart with dynamic options with Angularjs.
The problem is here:
{
"14": [
{
"id": 3,
"forma": "Alface",
"preco": 1
},
{
"3": 1
}
],
"15": [
{
"id": 3,
"forma": "Alface",
"preco": 1
},
{
"3": 1
}
]
}
I need that when I add the optional array, that the quantity joins it, being like this:
{
"14": [
{
"3": 1,
"id": 3,
"forma": "Alface",
"preco": 1
}
],
"15": [
{
"3": 1,
"id": 3,
"forma": "Alface",
"preco": 1
}
]
}
This is the ticket of the option:
$scope.ck = function(id) {
var oidsa = {"3": 1};
$scope.user.roles[id].push(oidsa);
alert($scope.user.roles[id]);
};
Edit your question and add the code you are using.
– André Ribeiro