Polymer 1.0: trouble with data-binding against plain Javascript object -


using polymer-starter-kit-1.0 (to going more quickly) trying establish data-binding against plain javascript objects (instead of other polymer custom-elements).

this seems initial value of property binding to.

for simplicity: added "test" object name property main app object,

  app.test = { 'name': 'john doe' } 

and added element on home page this:

  <h3>app name: <span>[[test.name]]</span></h3> 

this display initial value ('john doe').

when change name of javascript object javascript code directly, (on-click event of button) in app.test.name = 'jim smith' nothing changes in one-way bindings.

however, if add input element this:

  <input value="{{test.name::input}}" /> 

then span element updated when text changed in input element.

it if changes made directly javascript not observed polymer.

what doing wrong?

it looks may have not used bindings property properly. doesn't access polymer host object issue since you're using "app" variable... believe template/dom-bind tag.

use host.set(path,value) set objects , have them propagate changes.

this example should help: http://jsbin.com/daloho/2/edit?html,output


Comments

Popular posts from this blog

angularjs - ADAL JS Angular- WebAPI add a new role claim to the token -

php - CakePHP HttpSockets send array of paramms -

node.js - Using Node without global install -