title: Angular JS (Ionic) data Array to $scope Element
body: <p>i have little problem,</p>
  
  <p>i'm trying to get datas from my SQLite Database, the function is working,</p>
  
  <p>i just have a problem when i need to recovers my datas</p>
  
  <p>this is what i did :</p>
  
  <pre><code>     $scope.facilityDatas = {};
  
  
    dataBaseService.getFacilityById($stateParams.facilityId,function (data) {
      $scope.facilityDatas = angular.copy(data);
      console.log ('facility json : '+ angular.toJson($scope.facilityDatas));
    });
  </code></pre>
  
  <p>the data var contain a data array that contain my request result. i tested in my service, everything is good. now i just need to make $scope.facilityDatas = data but it's not working...</p>
  
  <p>I need to admit that i'm a bit lost. i'm almost sure it's nothing but i don't know what to do...</p>
  
  <p>Hope you'll find what's wrong.</p>
  
  <p>regards</p>
  
  <p><strong>EDIT</strong></p>
  
  <p>here's my DataBase function :</p>
  
  <pre><code>getFacilityById: function(id,callback){
  
              var data = [];
              $cordovaSQLite.execute(db,'select * from FACILITIES where facilities_id = ?',[id]).then(function (results){
                  console.log(angular.toJson(results.rows.item(0)));
  
                  for (var i = 0, max = results.rows.length; i &lt; max; i++) {
  
                      data.push(results.rows.item(i))
  
                  }
  
              })
  
  
  
              callback(data);
  
          },
  </code></pre>