我試圖將數據保存到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應用程序,但沒有試圖發生同樣的代碼是工作今天,當我去安慰數據庫沒有加載可能是他們的服務器關閉或別的東西發生 –