Hi all,
I have the following peace of code in my app.js file that will trow me an exception but I’ve no idea why and how to fix it.
import ‘es6-shim’;
import {App, Platform, Storage, SqlStorage} from ‘ionic-angular’;
import {StatusBar} from ‘ionic-native’;
import {TabsPage} from ‘./pages/tabs/tabs’;
@App({
providers: [Storage],
template: ‘<ion-nav [root]=“rootPage”>’,
config: {
tabbarPlacement: ‘top’
}
// Config - Ionic API Documentation - Ionic Framework
})
export class MyApp {
static get parameters() {
return [[Platform], [Storage]];
}
constructor(platform: Platform, storage: Storage) {
this.rootPage = TabsPage;
platform.ready().then(() => { // Okay, so the platform is ready and our plugins are available. // Here you can do any higher level native things you might need. StatusBar.styleDefault(); this.storage = new Storage(SqlStorage, null); this.storage.query("CREATE TABLE IF NOT EXIST people (id INTEGER PRIMARY KEY AUTOINCREMENT, name TEXT)").then((data) => { console.log("TABLE CREATED -> " + JSON.stringify(data.res)); }, (error) => { console.log("ERROR -> " + JSON.stringify(error.err)); }) });
}
}
Hope you guys might see what is wrong with this code.