【问题标题】:Error while setting up pouchdb-authentication (ionic)设置 pouchdb-authentication (ionic) 时出错
【发布时间】:2016-02-25 04:06:44
【问题描述】:

我是角度和离子的新手。我试图设置 pouchdb-authentication 并收到此错误。我一定在某个地方犯了一些错误,但我无法弄清楚。请帮忙。在发布之前,我搜索了这个问题 2 天,但没有找到解决方案。

在 app.js 中:

var localDB = new PouchDB('testLogin');
var remoteDB = new PouchDB('http://localhost:5984/testLogin', {skipSetup: true});

在我的服务中:

remoteDB.signup(userName, password, {
              metadata : {
                email : email
              }
            }, function (err, response) {
                if(err){
                    console.log("failure signup");
                } else{
                    console.log("success signup");
                }
            });


TypeError: remoteDB.signup is not a function
    at Object.self.signup (/localhost:8100/js/services/authentication.js:40:13)
    at Scope.$scope.signup (/localhost:8100/js/controllers/authentication.js:41:16)
    at fn (eval at <anonymous> (/localhost:8100/lib/ionic/js/ionic.bundle.js:26457:15), <anonymous>:4:320)
    at callback (/localhost:8100/lib/ionic/js/ionic.bundle.js:36610:17)
    at Scope.$eval (/localhost:8100/lib/ionic/js/ionic.bundle.js:29158:28)

【问题讨论】:

    标签: angularjs pouchdb


    【解决方案1】:

    该插件似乎并未实际安装。如果您使用&lt;script&gt; 标签,那么您只需要确保在 PouchDB 脚本之后声明身份验证脚本。否则你需要做PouchDB.plugin(require('pouchdb-authentication'))

    【讨论】:

    • 错误是在 PuchDB 脚本之前声明的身份验证脚本。非常感谢。
    猜你喜欢
    • 2019-04-24
    • 1970-01-01
    • 1970-01-01
    • 2016-11-16
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多