Polymer Firebase:Uncaught TypeError:无法读取未定义的属性'signInWithPopup'

时间:2016-07-31 13:53:33

标签: web firebase polymer firebase-authentication

我是Polymer和Firebase的新手,我正在练习这两种技术。我正在尝试使用firebase-auth进行应用程序身份验证,但我去了“无法读取属性'signInWithPopup'未定义”错误。

我有这段代码:

processAuth: function() {
    this.$.auth.signInWithPopup();
}

和processAuth的脚本

<link rel="import" href="../../bower_components/polymerfire/polymerfire.html">
<link rel="import" href="../../bower_components/polymerfire/firebase-auth.html">

已导入以下组件:

{{1}}

我错过了什么吗?

抱歉这个非常棒的问题。

2 个答案:

答案 0 :(得分:3)

在使用firebase-app

之前,请务必使用相同的app-name初始化firebase-auth

答案 1 :(得分:-2)

尝试使用document.getElementById('auth')代替this.$.auth

对我来说,this.$.auth正在尝试在#auth内找到paper-icon-button,而不是console.log(this)。 检查processAuth中的this以验证 $(document).ready(function () { var params = { 'IDPaziente': 6586 } $.ajax({ "dataType": 'json', "contentType": "application/json; charset=utf-8", "type": "GET", "url":"http://applicazioni.vsc300.it/Service.asmx/CercaPaziente", "data": params, "success": function (msg) { var json = jQuery.parseJSON(msg.d); //valorizza texbox $("#TXT_CognomePaziente").val(json.Denominazione); }, error: function (xhr, textStatus, error) { alert(error); } }); });指向的位置。

相关问题