mardi 31 mars 2015

Dynamically output the expression within each loop in handlebar emberjs

Suppose I have the following controller



App.SomeController = Ember.Controller.extend({
container: Ember.A(['one','two','three']),
attrOne: 'Attribute One',
attrTwo: 'Attribute Two',
attrThree: 'Attribute Three'
});


In my handlebars, I can loop each of the value in the container array, but how I can dynamically populate each attr within the each loop



{{#each data in container}}
{{data}} // one, two, three
{{???}} // {{attrOne}} {{attrTwo}} {{attrThree}} ??? How ???
{{/each}}




Aucun commentaire:

Enregistrer un commentaire