Iterating through child components

Posted by ken on Stack Overflow See other posts from Stack Overflow or by ken
Published on 2013-10-29T15:28:19Z Indexed on 2013/10/29 15:54 UTC
Read the original article Hit count: 175

Filed under:

I have button-group component which contains a set of button-element components. The template is defined as:

{{#each buttons}}
    {{button-element titleBinding="title" action="buttonAction"}}
{{/each}}

I'd like the buttonAction() method in the button-group component to have easy access to the set of button-element components and iterate through them. What's the easiest way to do this? I know I could use a jQuery/DOM approach like:

this.$('.btn').doSomething();

But I'd like to address the component objects not the DOM directly.

© Stack Overflow or respective owner

Related posts about ember.js