controller.hbs:
<div class="pad-xs-30b">
{{thing-collection
title=title
things=things
doAwesomeThingToThing=(action "doAwesomeThingToThing")
}}
</div>
<div>
{{thing-collection
title=title
things=things
doAwesomeThingToThing=(action "doAwesomeThingToThing")
archiveThing=(action "archive")
}}
</div>
thing-collection.js:
export default Ember.Component.extend({
// required params
things: null,
// optional params
doAwesomeThingToThing: Ember.K,
archiveThing: null,
});
thing-collection.hbs:
{{#each things as |thing|}}
{{thing-collection/item
thing=thing
doAwesomeThingToThing=doAwesomeThingToThing
archiveThing=archiveThing
}}
{{/each}}
thing-collection/item.js:
export default Ember.Component.extend({
// required params
thing: null,
// optional params
doAwesomeThingToThing: Ember.K,
archiveThing: null,
});
thing-collection/item.hbs:
<div>
<div>{{ thing.name }}</div>
{{#more-options-dropdown}}
<a class="DropDownOptions-item" {{action doAwesomeThingToThing thing}}>
Do Awesome Thing
</a>
{{#if archiveThing}}
<a class="DropDownOptions-item" {{action archiveThing thing}}>
Archive
</a>
{{/if}}
{{/more-options-dropdown}}
</div>