Sqlite update command need close and reopen application to work in ionic and ngCordova

I try to use ionic with ngCordova and sqlite but my update command
not work until my app close and reopen other operation like select and
insert word correctly but update command need reopen to apply.

This is my app.js code:

var db = null;

angular.module('dictionary', ['ionic', 'ngCordova', 'DataDictionary.controllers'])

.run(function($ionicPlatform, $cordovaSQLite) {
  $ionicPlatform.ready(function() {
    // Hide the accessory bar by default (remove this to show the accessory bar above the keyboard
    // for form inputs)
    if(window.cordova && window.cordova.plugins.Keyboard) {
      cordova.plugins.Keyboard.hideKeyboardAccessoryBar(true);
    }
    if(window.StatusBar) {
      // org.apache.cordova.statusbar required
      StatusBar.styleDefault();
    }

    db = $cordovaSQLite.openDB({ name: "dataContent.db" });
    $cordovaSQLite.execute(db, "CREATE TABLE IF NOT EXISTS dataList (Id integer primary key, Data text, FavoriteOrNot boolean)");
  });
})

And this is my favoriteToggle function in my controller:

$scope.FavoriteToggle = function(index) {

// LOG DB before fav toggle
    var q = "SELECT Id, Data, FavoriteOrNot FROM dataList ;";
    $cordovaSQLite.execute(db, q, [] ).then(function(res) {
      console.log("before fav toggle")
      for (var i = 0, len = res.rows.length; i < len; i++) {
        console.log(res.rows.item(i).Id + " / " + res.rows.item(i).Data + " / " + res.rows.item(i).FavoriteOrNot);
      }
    });
    // LOG DB

var query = "SELECT Id, Data, FavoriteOrNot FROM dataList WHERE Id = ?;";
    $cordovaSQLite.execute(db, query, [index] ).then(function(res) {
        if(res.rows.length > 0) {
          var favOrNot = res.rows.item(0).FavoriteOrNot;
          query = "";
          if (favOrNot == 0)
          {
            query = "UPDATE dataList SET FavoriteOrNot = 1 WHERE Id = ?;";

          } else{
                query = "UPDATE dataList SET FavoriteOrNot = 0 WHERE Id = ?;";
              }
              $cordovaSQLite.execute(db, query, [index]);
            }
        }, function (err) {
            alert(err);
        });

// LOG DB after fav toggle
    var q = "SELECT Id, Data, FavoriteOrNot FROM dataList;";
    $cordovaSQLite.execute(db, q, [] ).then(function(res) {
      console.log("after fav toggle")
      for (var i = 0, len = res.rows.length; i < len; i++) {
        console.log(res.rows.item(i).Id + " / " + res.rows.item(i).Data + " / " + res.rows.item(i).FavoriteOrNot);
      }
    });
    // LOG DB

All things seems correct but after execute update command both LOG (LOG DB before fav toggle & LOG DB after fav toggle) is equal and database data not update but after close and reopen my application all things is ok and last update result available. What is the problem??

I spend many hour to fix this issue. Please help. Sorry for my bad English.

I guess you should consider this functional App with Sqlite implementation here: https://codecanyon.net/item/quizionic-a-quiz-app-template-for-ionic-framework-with-sqlite-database/14205904