Polymer 1.0 notifyPath for array element -


simple example:

<template is="dom-repeat" items="{{items}}">     <template is="dom-repeat" items="{{item.subitems}}">         <span>{{item}}</span>     </template>     <span on-tap="add">add</span> </template>  attached: function () {     this.items = [         { subitems:[] },         { subitems:[] }     ] }, add: function (e) {     e.model.item.subitems.push("test"); } 

this not refresh dom-repeat {{item.subitems}}. how can notify polymer of change?

from docs

mutations items array (push, pop, splice, shift, unshift) must performed using methods provided on polymer elements, such changes observable elements bound same array in tree. example: this.push('employees', { first: 'jack', last: 'aubrey' });


Comments

Popular posts from this blog

javascript - gulp-nodemon - nodejs restart after file change - Error: listen EADDRINUSE events.js:85 -

Fatal Python error: Py_Initialize: unable to load the file system codec. ImportError: No module named 'encodings' -

javascript - oscilloscope of speaker input stops rendering after a few seconds -