OLD | NEW |
(Empty) | |
| 1 |
| 2 |
| 3 Polymer({ |
| 4 |
| 5 is: 'iron-input', |
| 6 |
| 7 extends: 'input', |
| 8 |
| 9 properties: { |
| 10 |
| 11 /** |
| 12 * Use this property instead of `value` for two-way data binding. |
| 13 */ |
| 14 bindValue: { |
| 15 observer: '_bindValueChanged', |
| 16 type: String |
| 17 } |
| 18 |
| 19 }, |
| 20 |
| 21 listeners: { |
| 22 'input': '_onInput' |
| 23 }, |
| 24 |
| 25 attached: function() { |
| 26 this.bindValue = this.value; |
| 27 }, |
| 28 |
| 29 _bindValueChanged: function() { |
| 30 this.value = this.bindValue; |
| 31 // manually notify because we don't want to notify until after setting val
ue |
| 32 this.fire('bind-value-changed', {value: this.bindValue}); |
| 33 }, |
| 34 |
| 35 _onInput: function(event) { |
| 36 this.bindValue = event.target.value; |
| 37 } |
| 38 |
| 39 }) |
OLD | NEW |