title: sample angularjs code which will connects to sqllite
body: <p>kindly provide a  sample code/link/tutorial which will connect to sqllite database from anugular js.
  I am new mobile development </p>
  
  <p>Basically when i am calling retriveProfileInfo function which is present in DataAccess.js </p>
  
  <p>retriveProfileInfo function is executing in different thread i wanted in synchronous way.
  Controller.js</p>
  
  <pre><code>mympn.controller('MyProfileController', function($scope, $location, ngDialog ) {
  
      $scope.myProfileData = {};
      $scope.myProfileDatalist = [];
      function callBack(d) {
          return d;
      }
      $scope.myProfileDatalist = retriveProfileInfo(callBack);
  
      alert(myProfileDatalist);
      console
              .log("After calling retriveProfileInfo ----------------");
  
  
  
  });
  </code></pre>
  
  <p>DataAccess.js</p>
  
  <pre><code>function retriveProfileInfo(callBack) {
      var db = DataBaseInstance.getInstance();
      var userProfileData = [];
      db.transaction(function(tx) {
          tx.executeSql("SELECT * from myprofile", [], function(tx, res) {
               for (var i = 0; i &lt; res.rows.length; i++) {
                   userProfileData[i] = res.rows.item(i);
                }
          });
      }, errorCB, sucessCB);
      console.log(userProfileData);
      return callBack(userProfileData);
  }
  </code></pre>