, Polymer 1.0 () . - .
, dom-bind. , dom-bind.
, domBind tapCount, tapMessage _tapMe. on-tap domBind div.
attached: function () {
var domBind = document.createElement('template', 'dom-bind');
domBind.tapCount = 0;
domBind.tapMessage = 'Tap me now!';
domBind._tapMe = function(e) {
this.tapCount = this.tapCount + 1;
this.tapMessage = 'Tapped ' + this.tapCount + ' time(s).';
};
var div = domBind.content.ownerDocument.createElement('div');
div.innerHTML = '<b on-tap="_tapMe">[[tapMessage]]</b>';
domBind.content.appendChild(div);
Polymer.dom(this.$.container).appendChild(domBind);
Polymer.dom.flush();
}
, ( Polymer 0.5 injectBoundHTML).
, :
...
var self = this;
domBind.externalMethod = function() {
return self._computeValue();
};
...
, externalMethod, "" "" . _computeValue , DOM attached.