Reputation: 743
This is the scope format I have
$scope.order.Transaction{
'source': value,
'fees': value,
'ref':value
}
How do I push the above data to existing $scope,can anyone please guide me in the right direction? This is what $scope.order.Transaction already contains: Object {source: "value", fees: "33", ref: "37226"} I want to push a new object to it.How to do it?
Upvotes: 0
Views: 82
Reputation: 495
$scope.order.Transactions = [];
$scope.order.Transaction = {
'source': value,
'fees': value,
'ref':value
};
$scope.order.Transactions.push($scope.order.Transaction);
Upvotes: 1
Reputation: 4611
Its an javascript thing not an angular
$scope.order.Transaction.source = 'someValue'
$scope.order.Transaction.fees = 'someValue'
$scope.order.Transaction.ref = 'someValue'
Upvotes: 1