mirror of
https://github.com/Polymer/polymer.git
synced 2025-02-25 18:55:30 -06:00
Fixes #3270.
This commit is contained in:
parent
7c20170d69
commit
7d0485b18d
@ -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
|
||||
|
@ -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
|
@ -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() {
|
||||
|
Loading…
Reference in New Issue
Block a user