我想第一次使用带有cordova框架的sqlite。正如我在教程中所读到的,我应该像这样使用 ngcordova:
if (window.cordova)
{
db = $cordovaSQLite.openDB({ name: "littlebird.db" }); //device
}
else
{
db = window.openDatabase("littlebird.db", '1', 'littlebird', 1024 * 1024 * 100); // browser
}
$cordovaSQLite.execute(db, "CREATE TABLE IF NOT EXISTS mobileContact (id integer primary key, name text, mobile text,exit integer)");
但在部署时面临问题
Uncaught TypeError: Cannot read property 'openDatabase' of undefined ng-cordova.min.js (9,20659)