Polymer. Update view after model changed -


this common question in polymer updating view when model updated (answer use this.set or this.push polymer methods).

but when have 2 elements:

first element:

properties:{   items: {     type: array   } },  somefunction: {   this.push('items', {'name': 'something'}); } 

second element has property bound 'items' first element

ready: function(){     this.items = firstelement.items; } 

i second element 'items' updated when 'items' updated on firstelement. can't manually notify secondelement, because of app restrictions.

so see (in devtools) model of second element correct ('items' contains objects), view isn't updated.

how update it?

you need set notity on property of first element receive changes outside of element itself

properties:{   items: {     type: array,     notify: true   } }, 

then, in secondelement can

<firstelement items="{{items}}" /> 

Comments

Popular posts from this blog

angular - Is it possible to get native element for formControl? -

unity3d - Rotate an object to face an opposite direction -

javascript - Why jQuery Select box change event is now working? -