Hi i have a problem about using sqlite inside app.component.ts i want select language from db and change language before open home page or open some page for once.
I use this code inside app.component.ts but it doesn’t work inside app.component.ts.
this.langname="";
this.sqlite.create({
name: 'madardaroo.db',
location: 'default'
})
.then((db: SQLiteObject) => {
db.executeSql('SELECT * FROM languages WHERE selected=1 LIMIT 1', [])
.then((data) => {
this.langname=data[1]["langname"];
})
.catch(e => {
this.langname="en";
});
})
.catch(e => {
});
How can i use sqlite inside app.component.ts ?