I would like to use websql with typescript with ionic

Viewed 10

returns error when trying to create database Websql Error: src/services/bd_service.ts:9:19 - error TS2339: Property 'openDatabase' does not exist on type 'Window & typeof globalThis'.

let bd = window.openDatabase("Cards","1.0","Bank Cart", 30000000 ~~~~~~~~~~~~

why this error how do i get it to work?

code public createDb() { let bd = window.openDatabase("Cards","1.0","Bank Cart", 30000000);

// create table in database bd.transaction(createTable, errorMessage, successShipping);

function createTable(tx){ tx.executeSql("CREATE TABLE IF NOT EXISTS message (id INTEGER primary key, name VARCHAR(50), description VARCHAR(50))"); }

function errorMessage(error){

console.log('ERRO',error.message)

} function successShipping(){

console.log('SUCCESS')

}

}

0 Answers
Related