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

Popular posts from this blog

networking - Vagrant-provisioned VirtualBox VM is not reachable from Ubuntu host -

c# - ASP.NET Core - There is already an object named 'AspNetRoles' in the database -

ruby on rails - ArgumentError: Missing host to link to! Please provide the :host parameter, set default_url_options[:host], or set :only_path to true -