polymer: notifyPath + dom-repeat do not work with new array items
Polymer 1.0 does not track data model changes automatically, there is a notifyPath method to notify Polymer elements about changes in data model.
https://www.polymer-project.org/1.0/docs/devguide/data-binding.html#set-path
What path should be notified when a new array item inserted to force refresh of <template is="dom-repeat">?
Non of these work:
this.notifyPath("array", this.array);
this.notifyPath("array.1", this.array[1]);
this.set("array." + this.array.length, {});
Here is a Plunker example to play with: http://plnkr.co/edit/UyoKIA90kJkkydO7Rhv4?p=preview
About this issue
- Original URL
- State: closed
- Created 9 years ago
- Comments: 27 (4 by maintainers)
This one works:
But in this case (same as
array.concat) thenotifyPathvalue argument is a new array, and I would like to keep the old one, only notify Polymer about changes inside.