我是聚合物和Firebase的新手,我正在练习这两种技术。我正在尝试为应用程序身份验证实施firebase-auth,但我去了一个“Can not read property”signInWithPopup'未定义的“错误。聚合物Firebase:未捕获TypeError:无法读取undefined属性'signInWithPopup'
我有这样的代码:
<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>
和processAuth
processAuth: function() {
this.$.auth.signInWithPopup();
}
脚本和以下组件已经导入:
<link rel="import" href="../../bower_components/polymerfire/polymerfire.html">
<link rel="import" href="../../bower_components/polymerfire/firebase-auth.html">
难道我错过了什么?
对不起,这很菜鸟问题。
之前的错误是告诉你,这个'。$。auth'是不确定的。 Polymer模块中的'template'标签内是否有'paper-toolbar'和'firebase-auth'标签?您正在使用的方法是访问嵌套在Polymer元素中的元素的正确方法。 – anthony
“firebase-auth.html”已经导入到“polymerfire.html”中。无需再次导入它。 – Mohammed