Dynamic property binding names in dom-repeat

26 views
Skip to first unread message

mande...@gmail.com

unread,
Oct 20, 2016, 5:27:08 PM10/20/16
to Polymer
I am creating some <app-route> elements in a <dom-repeat> as follows:

    <template is="dom-repeat" items="{{myItems}}">
      <app-route route="[[_route]]"
                 pattern="/view-{{index}}/:data"
                 data="{{_routeData}}"
                 active="{{_routeActive}}">
      </app-route>
    </template>

I'd like to use {{index}} within the data and active attribute values to create a dynamic binding property name such as {{_route{{index}}Data}} i.e evaluating {{index}} when creating the binding name. This would mean that they are unique for each route.

Is it possible to do this in Polymer? If not are there any alternative approaches?

Thanks,
Mark

(Originally asked on Stack Overflow http://stackoverflow.com/questions/40009627/can-you-dynamically-create-a-binding-property-name-in-polymer with no answer).

Reply all
Reply to author
Forward
0 new messages