Ionic sqlite db acess globally


how to acess sqlite db gloabally in ionic 2 using providers


Create a separate provider of your sqlite and you need to initialize public variable like:
public db: any;
in that provider.

After that import same provider and define it in providers list in your app.module.
After that on your screens simply import that provider, don’t define it in provider list. You will always get reference of same db variable (marked above)


Thanks @vaibhav915
can you please share some sample code so it will be very useful,thanks in advance