我试图使用couchbase与我的nativescript应用程序,但我在尝试输入正在使用它的组件时收到错误。
这是我的couchbase.servive.ts
import { Injectable } from "@angular/core";
import { Couchbase } from 'nativescript-couchbase';
@Injectable()
export class CouchbaseService {
private database: any;
public constructor() {
this.database = new Couchbase("confusion");
}
public getDatabase() {
return this.database;
}
public getDocument(docId: string) {
return this.database.getDocument(docId);
}
public createDocument(data: any, docId: string) {
return this.database.createDocument(data, docId);
}
public updateDocument(docId: string, data: any) {
return this.database.updateDocument(docId, data);
}
public deleteDocument(docId: string) {
return this.database.deleteDocument(docId);
}
}
在我的favorites.component.ts中
我导入了couchbase服务并像这样帮助docId(docId:string =“favorites”;)
我收到了这个错误
JS:MANAGER错误:无法读取未定义的属性'AndroidContext'JS:错误错误:未捕获(在promise中):TypeError:无法读取未定义的属性'getDocument'JS:TypeError:无法读取未定义的属性'getDocument'
nativescript-couchbase
插件不再维护。请使用最新的nativescript-couchbase-plugin
。