angularjs - Ionic Framework - Open sqlite database within device -
i've been using cordova sqlite when have db file inside www folder. problem have download db , unzip within device's documents.
that's code far (to database within www):
var app = angular.module('foobar'); app.factory('factorydatabase', function($cordovadialogs, $cordovasqlite, $ionicloading, $q, serviceconstants){ // current db.... var currentdb = undefined; var database_name = 'data.db'; var path = 'data.db'; return{ init: function(){ if (currentdb == undefined) { currentdb = window.sqliteplugin.opendatabase({ name: database_name, createfromresource: path }); } return currentdb; }, } }); the main problem path constant, it's pointing www folder (by default) , project (https://github.com/litehelpers/cordova-sqlite-storage) doesn't seem support changing path device's files both android , ios
anyone had similar issue?
thanks!
Comments
Post a Comment