How do I use the ngCordova sqlite service and the Cordova-SQLitePlugin with Ionic Framework?

后端 未结 4 791
误落风尘
误落风尘 2020-12-15 05:46

I have been trying to incorperate sqlite into a simple Ionic app and this is the process I have been following:

 ionic start myApp sidemenu

4条回答
  •  爱一瞬间的悲伤
    2020-12-15 06:40

    So Turns out that it is because Cordova is platform specific and doesn't work when you run ionic serve

    I was able to run the same code on an android device with out issue when I built and deployed.

    Update

    you can replace the cordova plugin with window to use the websql databases so instead of sqlitePlugin.openDatabase() you can use window.openDatabase()

提交回复
热议问题