【发布时间】:2018-02-06 16:44:59
【问题描述】:
我正在尝试连接到 PouchDB 数据库,但出现错误
Typescript Cannot use 'new' with an expression whose type lacks a call or construct signature
下面是我的代码:-
var PouchDB = require("pouchdb");
@Injectable()
export class PouchDBService {
private isInstantiated: boolean;
private database: any;
public constructor(private http: Http) {
if(!this.isInstantiated) {
this.database = new PouchDB("db_name"); <--error at this line
this.isInstantiated = true;
}
【问题讨论】:
标签: angular typescript pouchdb