Skip to content

Instantly share code, notes, and snippets.

@uno-de-piera
Created May 23, 2018 15:52
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save uno-de-piera/b8c9d1af06eff9a9bfccc2a8d8f3eaec to your computer and use it in GitHub Desktop.
Save uno-de-piera/b8c9d1af06eff9a9bfccc2a8d8f3eaec to your computer and use it in GitHub Desktop.
@Injectable()
export class LocalDbProvider {
public objDB;
/**
*
* @param platform
* @param sqlite
*/
constructor(
public platform: Platform,
public sqlite: SQLite
) {
platform.ready().then(() => {
if(!this.isOpen) {
this.objDB = this.sqlite.create({
name: 'app.db',
location: 'default'
});
this.isOpen = true;
}
});
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment