Quantcast
Channel: Ionic Forum - Latest posts
Viewing all articles
Browse latest Browse all 229350

Help me sqllite

$
0
0
i have error
ERROR TypeError: Cannot read property 'executeSql' of undefined
    at DatabaseProvider.webpackJsonp.148.DatabaseProvider.saveData (database.ts:64)
    at SafeSubscriber._next (domain.ts:30)
    at SafeSubscriber.__tryOrUnsub (Subscriber.js:238)
    at SafeSubscriber.next (Subscriber.js:185)
    at Subscriber._next (Subscriber.js:125)
    at Subscriber.next (Subscriber.js:89)
    at MapSubscriber._next (map.js:85)
    at MapSubscriber.Subscriber.next (Subscriber.js:89)
    at XMLHttpRequest.onLoad (http.js:1556)
    at t.invokeTask (polyfills.js:3) 

File T.S :
 check(){
    this.domain.checkdomain(this.domainn).subscribe(res=>{
      if(res.success== true){
        console.log(res.data);
        localStorage.setItem("domain",JSON.stringify(res.data));
        this.database.saveData(res.id,res.api_url,res.company,res.domain,res.email,res.site_logo);
        this.navCtrl.push(LoginPage);
      }else{
        let alert = this.alertCtrl.create({
          subTitle: res.message,
          buttons: [
           { text:'OK'}]
        })
        alert.present();
      }
    })
  }

File database.ts :slight_smile:
 saveData(id, api_url, company,domain,email,site_logo) {
    let data = [id, api_url, company,domain,email,site_logo]
    return this.database.executeSql("INSERT INTO domain (id, api_url, company,domain,email,site_logo) VALUES (?, ?, ?, ?, ?, ?)", data).then(data => {
      return data;
    }, err => {
      console.log('Error: ', err);
      return err;
    });
  }`Preformatted text``Preformatted text`

Viewing all articles
Browse latest Browse all 229350

Trending Articles



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