我试图将数据保存到firebase数据库中,但始终遇到TypeError。似乎无法找到问题所在。这里是我的<template>
代码:使用Polymerfire保存文档中的问题
<firebase-auth
id="auth"
app-name="notes"
provider="google"
signed-in="{{signedIn}}"
user="{{user}}">
</firebase-auth>
<firebase-document
id="document"
app-name="notes"
path="[[editableNoteId]]"
data="{{editableNote}}">
</firebase-document>
<na-editor
id="editor"
note="{{editableNote}}"
on-close="commitChange">
</na-editor>
脚本:
<script>
Polymer({
is: 'note-app',
behaviors: [Polymer.NoteAppBehavior],
signIn: function() {
this.$.auth.signInWithPopup();
},
get notesPath() {
return '/notes/' + this.user.uid;
},
toEditableId: function(noteId) {
return this.notesPath + '/' + noteId;
}
});
</script>
以下是错误:
TypeError: this.$.document.save is not a function. (In 'this.$.document.save(this.notesPath)', 'this.$.document.save' is undefined)
注:该应用程序名称和火力点,应用程序是否已经正确定义。
我也是从Android应用程序,但没有试图发生同样的代码是工作今天,当我去安慰数据库没有加载可能是他们的服务器关闭或别的东西发生 –