title: How to split two items inside a JSON array in angular
body: <p>This is my code:</p>
  
  <pre><code>$scope.center_name = [];
        $scope.stats = ["Stats"];
        $scope.totMemCenterData = [];
  
  
        var query = "SELECT count(*) as tot_mem, centers.name as center_name FROM mem_groups "
      + "INNER JOIN centers ON mem_groups.center_id=centers.id GROUP BY centers.id";
        $cordovaSQLite.execute(db, query, [])
        .then(function(res){
            if (res.rows.length &gt; 0) {
            for (var i=0; i &lt; res.rows.length; i++) {
              $scope.totMemCenterData = res.rows.item(i);
              console.log(JSON.stringify($scope.totMemCenterData));
  
            }
          }
        }, function(err){
            // $cordovaToast.showShortBottom('Something Went Wrong').then(function(success){}, function(err){});
            console.log(err.message);
        });
  </code></pre>
  
  <p>This is the result of <code>console.log(JSON.stringify($scope.totMemCenterData));</code> :</p>
  
  <pre><code>{"center_name":"AFG - ANONANG","tot_mem":6}
  {"center_name":"BAM - BUENAVISTA","tot_mem":3}
  {"center_name":"GHT - TAGAS","tot_mem":2}
  </code></pre>
  
  <p>I want to put all center_names in one array also the tot_mem on another array. I want it to be like:</p>
  
  <p>Centers: "AFG - ANONANG", "BAM - BUENAVISTA", "GHT - TAGAS"
  Tot_mem: 6, 3, 2
  I'm gonna put those values on a chart. Centers on the x-axis and tot_mem on the y-axis</p>