Is it possible to modify local/light DOM
from JS within a custom element in a way that would process bindings for thus dynamically added elements as if they were specified in template
?
Please consider the following snippet (a part of a custom element):
...
attached: function () {
var node = document.createElement('div');
Polymer.dom(node).innerHTML = '[[_computedValue()]]';
Polymer.dom(this.$.container).appendChild(node);
Polymer.dom.flush();
},
_computedValue: function() {
return "some value";
},
...
What I would like to happen is for the added div
to have its inner HTML equal to the value returned from method _computedValue
. The value cannot be assigned at the time of div
creation as in the real situation it would depend on the realtime context.