aw1975
aw1975

Reputation: 253

Polymer property not updating via data binding

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

Answers (1)

Srik
Srik

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

Related Questions