Jeremy Knees
Jeremy Knees

Reputation: 662

Use object in attribute

I want to use an attribute of my note object in my html attribute

<div id="disco-grid">
  <template repeat="{{note in _notes}}">
    <disco-pad note="{{note.midi}}"></disco-pad>
  </template>
</div>

The code

"{{note.midi}}"

is not evaluated and just returns it as a string, how can I do this?

Upvotes: 0

Views: 49

Answers (1)

Your code is correct. Make sure that you have specified the note attribute in your element

<polymer-element name="disco-pad" attributes="note">

If that still doesn't work try creating a stub of your _notes in your javascript file

Polymer({
    _notes: {
        midi: 'something'
    }
});

Upvotes: 1

Related Questions