将数组字符串保存到IndexedDB并从IndexedDB获取值并保存到字符串

时间:2017-12-08 19:05:38

标签: angular typescript indexeddb

我试试这个:

`

saveTasksList() {
    this.storage.setItem('tasks', this.tasksList).subscribe( () => {}, () => {});
  }
  loadTasksList() {
      this.tasksList = JSON.stringify(this.storage.getItem('tasks'));
  }

`

,但是:

ERROR in src/app/app.component.ts(42,7): error TS2322: Type 'Observable' is not assignable to type 'string[]'.

所有代码:https://pastebin.com/qfTLdRGd

0 个答案:

没有答案