Issue
I have 1 issue in ngCordova plugin cordovaSQLite. Below code:
var db = $cordovaSQLite.openDB({ name: "myDB.db" });
I'm using ionic serve 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
Could you please help me?
Solution
As stated by user jonnie in his answer
Cordova is platform specific and doesn't work when you run ionic serve
and
you can replace the cordova plugin with window to use the websql databases so instead of sqlitePlugin.openDatabase() you can use window.openDatabase()
It should work on actual devices just fine.
Answered By - Roope Hakulinen

0 comments:
Post a Comment
Note: Only a member of this blog may post a comment.