I have 1 issue in ngCordova plugin cordovaSQLite. Below code:
var db = $cordovaSQLite.openDB({ name: "myDB.db" });
i'm using "ionic serve" for run project in browser.
error: Uncaught TypeError: Cannot read property 'openDatabase' of undefinedng-cordova.js:5058
openDBapp.js:27
(anonymous function)ionic.bundle.js:37388
(anonymous function)ionic.bundle.js:2241
onPlatformReadyionic.bundle.js:2220
onWindowLoad
[Main error] http://i.stack.imgur.com/Yctpl.png
Could you please help me?
You will not get the desired result if you test in a web browser. You need an actual device, be it an Android or iOS. You can you use MEMU or Bluestack emulator to install and check if you don't want an actual device. Please don't consider other steps, that's a waste of time.
As stated by user jonnie in his answer
and
It should work on actual devices just fine.
You are getting this error because you are trying to get database connection from android but using wrong function openDatabase(). This function will use in case of client (browser). Use openDb() function to get database connection from android.