Reputation: 1117
I have 2 scope objects.
$scope.aaa;
$scope.bbb;
I want to pass it as list to backend.so I tried to store in single object.
$scope.fullData={$scope.aaa,$scope.bbb}
I tried to console $scope.fullData
.Its showing some red color error line in dot
of both objects.
How can I send it as single object/array/list?
Upvotes: 1
Views: 75
Reputation: 41447
change the curly brackets to square brackets if you want to send an array
$scope.fullData=[$scope.aaa,$scope.bbb]
Upvotes: 1
Reputation: 5825
Add property names to make it a valid object.
$scope.fullData = {
aaa: $scope.aaa,
bbb: $scope.bbb
}
Upvotes: 2