Skip to content

Instantly share code, notes, and snippets.

@jkarsrud
Created August 25, 2016 12:34
Show Gist options
  • Save jkarsrud/94f472e39cef97c30049aaef99285350 to your computer and use it in GitHub Desktop.
Save jkarsrud/94f472e39cef97c30049aaef99285350 to your computer and use it in GitHub Desktop.
FirstObject and Concat
import Ember from 'ember';
export default Ember.Component.extend({
});
import Ember from 'ember';
export default Ember.Controller.extend({
appName: 'Ember Twiddle',
question: {
all: [1,2,3,4,5]
}
});
<h1>Welcome to {{appName}}</h1>
<br>
<br>
{{outlet}}
<br>
<br>
{{#each question.all as |response index|}}
{{my-component name=(concat "response" index)
item=response current=question.all.firstObject}}
{{/each}}
{{yield}}
<p>Name: {{name}}</p>
<p>Item: {{item}} Current: {{current}}</p>
{
"version": "0.10.4",
"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.7.0",
"ember-data": "2.7.0",
"ember-template-compiler": "2.7.0"
},
"addons": {}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment