insert(table,data,callback){
let keys = Object.keys(data);
//INSERT INTO domain (id, api_url, company,domain,email,site_logo) VALUES (?, ?, ?, ?, ?, ?)"
let paras = "?,".repeat(keys.length);
paras = paras.substr(0,paras.length -1);
let sql = "INSERT INTO " + table + "(" + keys.join() + ") VALUES (" + paras +")" ;
return this.database.executeSql(sql,data).then(data =>{
callback(null,data);
},err =>{
callback(err);
})
}
ERROR
ERROR TypeError: Cannot read property 'executeSql' of undefined
at DatabaseProvider.webpackJsonp.148.DatabaseProvider.insert (database.ts:78)
at SafeSubscriber._next (domain.ts:31)
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)