How to append to a json object in angular js
$scope.releases = [{name : "All Stage",active:true}]; // Concatenate the new array onto the original $scope.releases = $scope.releases.concat([ {name : "Development",active:false}, {name : "Production",active:false}, {name : "Staging",active:false} ]);
Just use the Array concat method
$scope.release = [{name : "All Stage",active:true}];$scope.releases = [ {name : "Development",active:false}, {name : "Production",active:false}, {name : "Staging",active:false}];$scope.releases = $scope.releases.concat($scope.release);
user angular.extend() to extend the objectangular extend
you can also use angular.merge() angular merge