Reputation: 253
I have a Polymer 1.0 custom element that wraps a text box (an HTML input element). Here is the template:
<template>
<input type="text" value="{{value}}">
</template>
And here is the value property:
value: {
type: String,
value: '',
notify: true,
observer: '_valueChanged'
}
As I type into the text box shouldn't the _valueChanged observer get invoked each time the input text is updated? The behaviour I'm encountering is that the observer only gets called once during initialisation of the custom element.
Upvotes: 1
Views: 1135
Reputation: 2381
You need to bind as below. Read https://www.polymer-project.org/1.0/docs/devguide/data-binding.html#two-way-native for more details.
<template>
<input type="text" value="{{value::input}}">
</template>
Upvotes: 2