【发布时间】:2017-12-11 06:04:58
【问题描述】:
我收到此错误:预期有 1 个参数,但在我的数据库提供程序中得到 0。...我正在尝试创建本地存储。
数据库.ts
import { HttpClient } from '@angular/common/http';
import { Injectable } from '@angular/core';
import { Storage } from '@ionic/storage';
@Injectable()
export class DatabaseProvider {
local : any;
constructor(public http: HttpClient) {
console.log('Hello DatabaseProvider Provider');
this.local = new Storage();
}
}
我的错误是创建新存储“this.local = new Storage();”时的行...所以, Storage() 似乎在等待一个参数...什么参数?我已经尝试使用“localstorage”,但它仍然无法正常工作
【问题讨论】:
标签: ionic-framework local-storage