This commit is contained in:
Steven Orvell 2016-01-05 14:35:21 -08:00
parent 7c20170d69
commit 7d0485b18d
3 changed files with 29 additions and 1 deletions

View File

@ -33,7 +33,6 @@ subject to an additional IP rights grant found at http://polymer.github.io/PATEN
createdCallback: function() {
Polymer.telemetry.instanceCount++;
this.isAttached = false;
this.root = this;
this._doBehavior('created'); // abstract
this._initFeatures(); // abstract

View File

@ -468,3 +468,23 @@
<input id="input" value$="{{inputValue}}">
</template>
</dom-module>
<dom-module id="x-bind-is-attached">
<template>
<div id="check">{{isAttached}}</div>
</template>
<script>
Polymer({
is: 'x-bind-is-attached',
properties: {
isAttached: {
observer: '_isAttachedChanged'
}
},
_isAttachedChanged: function() {}
});
</script>
</dom-module>
<s

View File

@ -719,6 +719,15 @@ suite('binding corner cases', function() {
assert.equal(el.$.binding.textContent, 'binding');
});
test('bind to isAttached', function() {
var el = document.createElement('x-bind-is-attached');
sinon.spy(el, '_isAttachedChanged');
document.body.appendChild(el);
Polymer.dom.flush();
assert.equal(el.$.check.textContent, 'true');
assert.isTrue(el._isAttachedChanged.calledOnce);
document.body.removeChild(el);
});
});
suite('compound binding / string interpolation', function() {