I'm trying to save data into firebase database but always run into TypeError. Can't seem to find what the issue is. Here is my <template>
code:
<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:
<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>
Here is the error:
TypeError: this.$.document.save is not a function. (In 'this.$.document.save(this.notesPath)', 'this.$.document.save' is undefined)
NOTE: The app-name and firebase-app have been defined correctly.