I get this error in every page where i write import statement.
code that i used
import {Injectable} from ‘@angular/core’;
import {Storage, SqlStorage} from ‘ionic-angular’;
this error came when i evaluate code in google chrome otherwise in normal running it was not display this error.
ionic information
Cordova CLI: 6.2.0
Ionic Framework Version: 2.0.0-beta.10
Ionic CLI Version: 2.0.0-beta.32
Ionic App Lib Version: 2.0.0-beta.18
OS: Windows 8.1
Node Version: v4.4.6
itlr
2
You should probably post your code and complete error message here before anyone can lend a hand.
Whole code
import {WebService} from './services/webservice';
import {StatusBar} from 'ionic-native';
import {DatabaseHelper} from './services/DatabaseHelper';
import {Storage, SqlStorage} from 'ionic-angular';
@Component({
template: '<ion-nav [root]="rootPage"></ion-nav>'
})
export class MyApp {
rootPage: any = LoginTabPage;
//public db: SQLite;
db : DatabaseHelper;
storage: Storage = null;
constructor(platform: Platform) {
platform.ready().then(() => {
StatusBar.styleDefault();
this.db = new DatabaseHelper();
let options = {
name: '_Novity', // the name of the database
backupFlag: SqlStorage.BACKUP_LOCAL, // where to store the file
existingDatabase: false // load this as an existing database
};
this.storage = new Storage(SqlStorage, options);
this.db.createMemberTable();
this.db.createLoginTable();
var sql = 'INSERT INTO ' + this.db.sqtable_UserInfo + ' ( '+this.db.COLUMN_userId +' , '+ this.db.COLUMN_password + ' ) VALUES ( ?, ?)';
this.storage.query(sql, ['varshil','shah']).then((res) => {
console.log(res);
}, (err) => {
console.log('Error: ', err.res);
});
});
}
}
enableProdMode();
ionicBootstrap(MyApp,[WebService]);
when i evalute code in chrome i got below error
Uncaught SyntaxError: Unexpected token import