angularjs - Uncaught TypeError: Cannot read property 'openDatabase' of undefined -


i want work sqlite cordova framework first time. i've read on tutorial should use ngcordova this:

  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)"); 

but facing issue while deployment

uncaught typeerror: cannot read property 'opendatabase' of undefined ng-cordova.min.js (9,20659) 

edit :

specifying location solve problem :

db = $cordovasqlite.opendb({ name: "dbname.db" ,location:'?'});

(look in comments of answers post more details. )


Comments

Popular posts from this blog

angular - Is it possible to get native element for formControl? -

unity3d - Rotate an object to face an opposite direction -

javascript - Why jQuery Select box change event is now working? -