title: How to append to a json object to existing json in angular js
body: <p>How to append to a json object to existing json in angular js</p>
  
  <p>I am having an object like this </p>
  
  <pre><code>$scope.object1 = {
    data1: 'abc',
    data2: 1
  };
  
  
  $scope.object2 = {    
    data3:"One",
    data4:["a","b","c"]
  };
  </code></pre>
  
  <p>How to append $scope.object2 to $scope.object1</p>
  
  <p>So the final data should be like this</p>
  
  <pre><code>$scope.object1 = {
    data1: 'abc',
    data2: 1,
    data3:"One",
    data4:["a","b","c"]
  };
  </code></pre>
  
  <p>I am using this but its not working</p>
  
  <pre><code>angular.forEach($scope.object1, function(obj)
  {              
      obj.data3 = $scope.object2.data3;
  
      obj.data4 = $scope.object2.data4;
  
  });         
  </code></pre>