0

我正在尝试在我的 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');

});
4

1 回答 1

2

SqlStorage不包含在ionic-native. 所以你必须像这样导入它:

import {Storage, SqlStorage} from 'ionic-angular';
于 2016-07-31T07:11:32.013 回答