title: Joining a series of arrays into one 'parent' array (AngularJS)
body: <p>I have a series of arrays, filled with objects - in JSON format. They look something like this:</p>
  
  <p><strong>Group 1</strong></p>
  
  <pre><code>[
      { "name" :  "John",
        "age"  :  "31"
      },
      { "name" :  "Bob",
        "age"  :  "33"
      }
  ]
  </code></pre>
  
  <p><strong>Group 2</strong></p>
  
  <pre><code>[
      { "name" :  "Jim",
        "age"  :  "46"
      },
      { "name" :  "Harry",
        "age"  :  "23"
      }
  ] // ... and so on ...
  </code></pre>
  
  <p>In Angular, how can I join the two arrays to form an array of arrays? I'm guessing it's <code>group1.concat(group2)</code>, or something like that? I'm not sure where to do it though, would I do this in the controller? </p>
  
  <p>Currently I have a $scope property assigned to each variable, would I make a new $scope property that was a concatenated array of each of these? </p>
  
  <p>And would that be something like:</p>
  
  <pre><code>$scope.allGroups = []
  
  $scope.allGroups = $scope.group1.concat($scope.group2)
  
  // since 'allGroups', 'group1', and 'group2' have all been defined can I do...
  
  allGroups = group1.concat(group2) // ...or does $scope need to be used each time?
  </code></pre>
  
  <p>My intention is (with the necessary filters) to be able to do an ng-repeat through all groups as they will now all be linked to one $scope variable.</p>
  
  <p>I'm pretty sure that's laiden with errors, but I thought it better to provide some bad code than nothing at all, just so it was more evident what I was trying to do. If there are better approaches (which I'm sure there are), I'm all ears.</p>
  
  <p>Thanks in advance</p>