Quantcast
Channel: Ionic Forum - Latest topics
Viewing all articles
Browse latest Browse all 70920

Use sqlite inside app.component.ts

$
0
0

@hossein22 wrote:

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 ?

Posts: 1

Participants: 1

Read full topic


Viewing all articles
Browse latest Browse all 70920

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>