Let Me Tink About It
Let Me Tink About It

Reputation: 16132

Polymer 1.0: Data binding variable to <iron-meta> element (value attribute)

In Polymer 1.0, I am trying to data bind a string variable {{str}} to an <iron-meta> element (tag in parent element) as follows.

This fails:

<iron-meta id="meta" key="info" value="{{str}}"></iron-meta>

The above code breaks. But the following code works (without the binding).

This works:

<iron-meta id="meta" key="info" value="foo/bar"></iron-meta>

The difference is the variable version {{str}} fails and the constant version "foo/bar" works.

Does anyone have a clue what is what is breaking the binding and how to fix it?

Edits in response to comment questions:

  1. How does it fail? This fails silently. The values I have printed out simply do not update when I press the Login and Register buttons.

  2. Here is a link to the code in a Github repository. See lines

Upvotes: 1

Views: 1070

Answers (1)

epascarello
epascarello

Reputation: 207557

You need to use an attribute binding and not a property binding

<input type="text" value$="{{str}}" />

Upvotes: 2

Related Questions