1

I'm using websql in angular 4 project , but Typescript can't find some of the types:

 this.db = openDatabase('tes', '1.0', 'test', 2 * 1024 * 1024);

But some how is accepting the transaction :

this.db.transaction(function (tx) {
  tx.executeSql(query);
  tx.executeSql(qr);
})

I'm always getting :

error TS2304: Cannot find name 'openDatabase'

Daniel Larsson
  • 527
  • 2
  • 6
  • 23
azza
  • 84
  • 8
  • what is OpenDatabase? – Sajeetharan Nov 12 '18 at 16:28
  • it's the name of the method, in js it is by default exsist , i tried to follow this tuto in websql : https://www.thepolyglotdeveloper.com/2015/02/using-websql-instead-local-storage-web-app/ – azza Nov 12 '18 at 16:30
  • I found the solution in this and it worked: https://stackoverflow.com/questions/44385151/angular-2-websql-typings – azza Nov 13 '18 at 10:43

0 Answers0