Skip to content

Instantly share code, notes, and snippets.

@mattmarcum
Last active September 2, 2016 20:44
Show Gist options
  • Save mattmarcum/0014f802252097c9265f768b1c143561 to your computer and use it in GitHub Desktop.
Save mattmarcum/0014f802252097c9265f768b1c143561 to your computer and use it in GitHub Desktop.
New Twiddle
import Ember from 'ember';
export default Ember.Controller.extend({
appName: 'Ember Twiddle',
canFoo: {
0: 'sdfg',
1: 'wer'
},
foos: [
'foo 1',
'foo 2'
]
});
<h1>no worky</h1>
{{#each foos as |foo index|}}
{{foo}}: {{get canFoo index}}<br/>
{{/each}}
<h1>works, but ugly syntax</h1>
{{#each foos as |foo index|}}
{{foo}}: {{get canFoo (concat '' index)}}<br/>
{{/each}}
{
"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