【问题标题】:nativescript - couchbase cannot read property getDocumentnativescript - couchbase 无法读取属性 getDocument
【发布时间】:2019-02-22 05:31:42
【问题描述】:

我正在尝试将 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);
    }
}

在我的收藏夹.component.ts

我导入 couchbase 服务并像这样分配 docId ( docId: string = "收藏夹"; )

我收到了这个错误

JS:管理器错误:无法读取未定义的属性“AndroidContext” JS:错误错误:未捕获(承诺):TypeError:无法读取未定义的属性“getDocument” JS:TypeError:无法读取未定义的属性“getDocument”

【问题讨论】:

  • 您确定您使用的是正确的插件吗?您应该使用自述文件中所述的nativescript-couchbase-pluginnativescript-couchbase 不再维护。
  • 非常感谢!!!是的,我使用了错误的插件

标签: typescript nativescript couchbase


【解决方案1】:

nativescript-couchbase 插件不再维护。请使用最新的nativescript-couchbase-plugin

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 2019-08-04
    • 2018-08-04
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2021-01-15
    • 1970-01-01
    相关资源
    最近更新 更多