Javascript 如何使用ng repeat angularjs将sqlite中的数据显示到列表中
我正在使用这段代码,无法弄清楚如何将数据库中的数据填充到离子列表中Javascript 如何使用ng repeat angularjs将sqlite中的数据显示到列表中,javascript,angularjs,sqlite,ionic,Javascript,Angularjs,Sqlite,Ionic,我正在使用这段代码,无法弄清楚如何将数据库中的数据填充到离子列表中 $scope.selectAll = function() { $scope.allSessions= []; var query = "SELECT * FROM tb_sessions7"; $cordovaSQLite.execute(db, query, []).then(function(res) { if(res.rows.length > 0) {
$scope.selectAll = function() {
$scope.allSessions= [];
var query = "SELECT * FROM tb_sessions7";
$cordovaSQLite.execute(db, query, []).then(function(res) {
if(res.rows.length > 0) {
console.log("SELECTED -> " + res.rows.item(0).name + " " + res.rows.item(0).amount);
for (var i=0; i<res.rows.length; i++) {
$scope.allSessions.push(res.rows.items(i).name);
//console.log("data->"+$scope.allSessions);
}
} else {
console.log("No results found");
}
}, function (err) {
console.error(err);
});
}
$scope.selectAll=function(){
$scope.allSessions=[];
var query=“选择*来自tb\U会话7”;
$cordovaSQLite.execute(db,query,[]),然后(function(res){
如果(res.rows.length>0){
console.log(“选定->”+res.rows.item(0).name+“”+res.rows.item(0).amount);
对于(var i=0;i最终我得到了解
$scope.selectAll = function() {
var query = "SELECT * FROM tb_sessions7";
$cordovaSQLite.execute(db, query, []).then(function(res) {
if(res.rows.length > 0) {
console.log("SELECTED -> " + res.rows.item(0).id + " " + res.rows.item(0).s_id);
for (var i=0; i<res.rows.length; i++) {
$scope.allSessions.push({
id: res.rows.item(i).id,
s_id: res.rows.item(i).s_id,
name: res.rows.item(i).name,
amount: res.rows.item(i).amount,
total_sessions: res.rows.item(i).total_sessions,
commission: res.rows.item(i).commission,
total_order: res.rows.item(i).total_order,
created_date: res.rows.item(i).created_date,
last_edit: res.rows.item(i).last_edit
});
}
} else {
console.log("No results found");
}
}, function (err) {
console.error("error=>"+err);
});
}
$scope.selectAll=function(){
var query=“选择*来自tb\U会话7”;
$cordovaSQLite.execute(db,query,[]),然后(function(res){
如果(res.rows.length>0){
console.log(“选定->”+res.rows.item(0.id+”+res.rows.item(0.s\id));
对于(var i=0;i最终我得到了解
$scope.selectAll = function() {
var query = "SELECT * FROM tb_sessions7";
$cordovaSQLite.execute(db, query, []).then(function(res) {
if(res.rows.length > 0) {
console.log("SELECTED -> " + res.rows.item(0).id + " " + res.rows.item(0).s_id);
for (var i=0; i<res.rows.length; i++) {
$scope.allSessions.push({
id: res.rows.item(i).id,
s_id: res.rows.item(i).s_id,
name: res.rows.item(i).name,
amount: res.rows.item(i).amount,
total_sessions: res.rows.item(i).total_sessions,
commission: res.rows.item(i).commission,
total_order: res.rows.item(i).total_order,
created_date: res.rows.item(i).created_date,
last_edit: res.rows.item(i).last_edit
});
}
} else {
console.log("No results found");
}
}, function (err) {
console.error("error=>"+err);
});
}
$scope.selectAll=function(){
var query=“选择*来自tb\U会话7”;
$cordovaSQLite.execute(db,query,[]),然后(function(res){
如果(res.rows.length>0){
console.log(“选定->”+res.rows.item(0.id+”+res.rows.item(0.s\id));
对于(var i=0;i