Web Polymer Firebase:未捕获类型错误:无法读取属性';使用弹出窗口'进行登录;未定义的
我是聚合物和Firebase的新手,我正在练习这两种技术。我正在尝试为应用程序身份验证实现firebase身份验证,但出现了“无法读取未定义属性'signInWithPopup'的”错误 我有以下代码:Web Polymer Firebase:未捕获类型错误:无法读取属性';使用弹出窗口'进行登录;未定义的,web,firebase,polymer,firebase-authentication,Web,Firebase,Polymer,Firebase Authentication,我是聚合物和Firebase的新手,我正在练习这两种技术。我正在尝试为应用程序身份验证实现firebase身份验证,但出现了“无法读取未定义属性'signInWithPopup'的”错误 我有以下代码: <paper-toolbar> <span class="title">Sample!</span> <paper-icon-button icon="[[statusIcon(signedIn)]]" on-tap="proce
<paper-toolbar>
<span class="title">Sample!</span>
<paper-icon-button
icon="[[statusIcon(signedIn)]]"
on-tap="processAuth">
</paper-icon-button>
</paper-toolbar>
<firebase-auth
id="auth"
app-name="emotions"
provider="google"
signed-in="{{signedIn}}"
user="{{user}}">
</firebase-auth>
并且已经导入了以下组件:
<link rel="import" href="../../bower_components/polymerfire/polymerfire.html">
<link rel="import" href="../../bower_components/polymerfire/firebase-auth.html">
我错过什么了吗
很抱歉,我问了这个问题 尝试使用
document.getElementById('auth')
而不是this.$.auth
在我看来,this.$.auth
试图在纸张图标按钮中找到一个#auth
,但该按钮不在那里。
检查processAuth
中的console.log(this)
以验证此指向的位置。在使用firebase auth之前,请确保使用相同的app name
初始化firebase app
。auth
未定义。paper工具栏
和firebase auth
标记是否位于聚合元素的模板
标记内?您使用的方法是访问嵌套在聚合元素中的元素的正确方法。“firebase auth.html”已导入到“polymerfire.html”中。无需再次导入。document.getElementById('auth')
用于访问聚合元素之外的项目。但是我们如何做到这一点?
<link rel="import" href="../../bower_components/polymerfire/polymerfire.html">
<link rel="import" href="../../bower_components/polymerfire/firebase-auth.html">