i have little problem,
i'm trying to get datas from my SQLite Database, the function is working,
i just have a problem when i need to recovers my datas
this is what i did :
$scope.facilityDatas = {};
dataBaseService.getFacilityById($stateParams.facilityId,function (data) {
$scope.facilityDatas = angular.copy(data);
console.log ('facility json : '+ angular.toJson($scope.facilityDatas));
});
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...
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...
Hope you'll find what's wrong.
regards
EDIT
here's my DataBase function :
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 < max; i++) {
data.push(results.rows.item(i))
}
})
callback(data);
},