2
我正在使用Ionic 2.尝试在本地存储中设置字符串。未设置本地存储
import { Storage } from '@ionic/storage';
constructor(public storage: Storage) {
}
createChat(chatItem: any): void {
this.storage.ready().then(() => {
var jsonString = JSON.stringify(chatItem);
this.storage.set('chat/' + chatItem.$key + '/', jsonString);
});
}
但是,当我看着Chrome的开发人员工具时,未设置该值。
任何帮助表示赞赏。
是的,它的存在。非常感谢你 – Richard