I have been developing an app with ionic. And I have used SQLite. I have executed a query but I can't console log the value. Here's the code snippet:
var query = "SELECT SUM(total) FROM items";
console.log(query);
$cordovaSQLite.execute(db, query, []).then(function (res) {
console.log(res.rows[0]);
$scope.grand = {};
$scope.grand = res.rows[0];
console.log($scope.grand.SUM);
}, function (err) {
console.error("error=>" + err);
});
I want to directly console log the value of SUM(total). But, the log shows like below:
Object {SUM(total): 400}
SUM(total):400
How do I directly console log 400?