我是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}}
我错过了什么吗?
抱歉这个非常棒的问题。
答案 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);
}
});
});
指向的位置。