Skip to content

Instantly share code, notes, and snippets.

@Kerrick
Last active April 25, 2016 21:07
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save Kerrick/c18e7d46622bf961517e4ca704ad0319 to your computer and use it in GitHub Desktop.
Save Kerrick/c18e7d46622bf961517e4ca704ad0319 to your computer and use it in GitHub Desktop.
Yielded Block Spacing Issues
import Ember from 'ember';
export default Ember.Component.extend({
tagName: ''
});
import Ember from 'ember';
export default Ember.Controller.extend({
items: [
'bananas',
'apples',
'oranges'
]
});
<h1>Welcome to {{appName}}</h1>
<br>
<br>
My favorite foods are
{{#my-component items=items as |item|}}
{{item}}
{{/my-component}}
and a bowl of soup. (Note the awkward spaces between the items and the commas.)
<br>
<br>
My favorite foods are
{{#my-component items=items as |item|}}
{{~item~}}
{{/my-component}}
and a bowl of soup. (This works, but I don't feel like I should have to use <code>~</code> here.)
{{#each items as |item|}}
{{yield item}},
{{/each}}
{
"version": "0.7.2",
"EmberENV": {
"FEATURES": {}
},
"options": {
"use_pods": false,
"enable-testing": false
},
"dependencies": {
"jquery": "https://cdnjs.cloudflare.com/ajax/libs/jquery/1.11.3/jquery.js",
"ember": "https://cdnjs.cloudflare.com/ajax/libs/ember.js/2.4.4/ember.debug.js",
"ember-data": "https://cdnjs.cloudflare.com/ajax/libs/ember-data.js/2.4.3/ember-data.js",
"ember-template-compiler": "https://cdnjs.cloudflare.com/ajax/libs/ember.js/2.4.4/ember-template-compiler.js"
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment