I'm trying to use SQLite on an Ionic 2 project
ionic start App_One blank --v2 --ts
Then I install the platform:
ionic platform add android
ionic platform add ios
Then SQLite plugin:
ionic plugin add cordova-sqlite-storage --save
But when I try to initialize my provider as follows:
ionic g provider db-service
Then
import { Injectable } from '@angular/core';
import { SQLite } from 'ionic-native';
@Injectable()
export class DbService {
db: SQLite = null;
constructor() {
console.log('Hello DbService Provider');
this.db = new SQLite();
}
}
I have the following error: "Cannot find name 'SQLite'"
I have try:
npm install
ionic state restore
Any idea?
Thx
Info:
Cordova CLI: 6.5.0
Ionic Framework Version: 2.3.0
Ionic CLI Version: 2.2.1
Ionic App Lib Version: 2.2.0
Ionic App Scripts Version: 1.1.4
ios-deploy version: Not installed
ios-sim version: Not installed
OS: Linux 4.4
Node Version: v7.8.0
Xcode version: Not installed