samedi 21 février 2015

Can you bind a dynamically named property to an ember component?

I'm looping over an array controller and I'd like to bind a property like I do normally -the only exception is that I'd like to include the index in the property name (doing some type of dynamic concat)


Here is what I need



{{#each person in controller}}
{{#my-thing myProp=name0/1/2/3/etc}}invalid name{{/my-thing}}
{{/each}}


I realize I can get the index in handlebars like so



{{_view.contentIndex}}


...but I'd like to set the myProp equal to name 0/1/2/etc (whatever the index is at that time).


I realize that if I cannot do this the 2nd option is to update my component to do this using the index I pass in. I'm just looking for other options





Aucun commentaire:

Enregistrer un commentaire