Skip to content

Instantly share code, notes, and snippets.

@GavinJoyce
Created April 2, 2018 11:45
Show Gist options
  • Save GavinJoyce/5b810f41d83b98b2620e67c2909066c8 to your computer and use it in GitHub Desktop.
Save GavinJoyce/5b810f41d83b98b2620e67c2909066c8 to your computer and use it in GitHub Desktop.
yield within each
import Ember from 'ember';
export default Ember.Component.extend({
});
import Ember from 'ember';
export default Ember.Controller.extend({
items: undefined,
init() {
this._super(...arguments);
this.set('items', ['aa', 'bb', 'cc']);
}
});
There are {{items.length}} items:
{{#super-list items=items as |item|}}
an item: {{item}}
{{/super-list}}
<ul>
{{#each items as |item|}}
<li>
[{{yield item}}]
</li>
{{/each}}
</ul>
{
"version": "0.13.1",
"EmberENV": {
"FEATURES": {}
},
"options": {
"use_pods": false,
"enable-testing": false
},
"dependencies": {
"jquery": "https://cdnjs.cloudflare.com/ajax/libs/jquery/1.11.3/jquery.js",
"ember": "2.16.2",
"ember-template-compiler": "2.16.2",
"ember-testing": "2.16.2"
},
"addons": {
"ember-data": "2.16.3"
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment