可组合组件

parent-component.hbs 里面

{{yield (hash
   child=(
     component 'child-component'
     onaction=(action 'parentAction')
   )
)}}

parent-component.js 里面

export default Ember.Component.extend({
  actions: {
    // We pass this action to the child to call at it's discretion
    parentAction(childData) {
      alert('Data from child-component: ' + childData); 
    }
  }
});

child-component.js 里面

export default Ember.Component.extend({
  // On click we call the action passed down to us from the parent
  click() {
    let data = this.get('data');
    this.get('onaction')(data); 
  }
});

usage.hbs 里面

{{#parent-component as |ui|}}
  {{#each model as |item|}}
    {{ui.child data=item}}
  {{/each}}
{{/parent-component}}