Actually make computed readOnly:true. Add more tests.

This commit is contained in:
Kevin Schaaf
2015-06-24 15:56:50 -07:00
parent 259efb8aaf
commit 20b8fc22a9
4 changed files with 38 additions and 4 deletions

View File

@@ -248,6 +248,10 @@
computedvalue="[[boundcomputedvalue]]"
computednotifyingvalue="[[boundcomputednotifyingvalue]]">
</x-basic>
<x-basic id="basic3"
notifyingvalue="{{computedValue}}"
computedvalue="{{value}}">
</x-basic>
</template>
<script>
Polymer({
@@ -259,6 +263,17 @@
'boundcomputednotifyingvalueChanged(boundcomputednotifyingvalue)',
'boundreadonlyvalueChanged(boundreadonlyvalue)'
],
properties: {
a: {
value: 10
},
b: {
value: 20
},
computedValue: {
computed: 'computeComputedValue(a, b)'
}
},
created: function() {
this.observerCounts = {
boundvalueChanged: 0,
@@ -268,6 +283,9 @@
boundreadonlyvalueChanged: 0
};
},
computeComputedValue: function(a, b) {
return a + b;
},
clearObserverCounts: function() {
for (var i in this.observerCounts) {
this.observerCounts[i] = 0;