Polymer 2.0 + firebase can't update properly -
i've got problem using polymer 2.0 , firebase. want update data firebase firebase-document
when want update title, destroy previous data , save title.
example of strucute before update :
myapp: categories: 1: logoname: test.png title: test
and after :
myapp: categories: 1: title: test bis
do have give entire record , update field want or can give field want update savevalue
. try give field doesn't seem work
here part of code :
<dom-module id="categorie-form"> <template> <firebase-document id="document" app-name="myapp" data="{{categoriedata}}"> </firebase-document> <iron-form id="categorieironform"> <form id="categorieform"> <label for="title">nom de la catégorie</label> <input type="text" name="title" id="title" value="[[name]]"> <paper-button id="validbutton" on-click="_submitcategorie" raised>valider</paper-button> </form> </iron-form> </template> <script> class categorieform extends polymer.element { static () { return "categorie-form" } static properties () { return { categoriedata: { type: object } } } _submitcategorie () { this.categoriedata = { title: form.title.value }; this.$.document.savevalue('/categories', key) } } customelements.define(categorieform.is, categorieform); </script> </dom-module>
thank you
try :
this.$.document.savevalue('/categories/1/title', key)
Comments
Post a Comment