我试图在我的Ionic2应用程序中设置SqlStorage,但我没有幸运,因为我收到以下错误:
我遵循文档,但那不起作用!
_ionicNative.Storage不是构造函数
import {SqlStorage, Storage, StatusBar} from 'ionic-native';
SaveInfo(){
this.storage = new Storage(SqlStorage, { name: 'userInfo' });
return this.http.get(this.postUrl, {search:params})
.subscribe(
data => {
this.storage.set('userName', 'Jhonny23');
this.storage.set('userType', 'Normal');
});
答案 0 :(得分:2)
SqlStorage
未包含在ionic-native
中。所以你必须像这样导入它:
import {Storage, SqlStorage} from 'ionic-angular';