Skip to content

Instantly share code, notes, and snippets.

@abuiles
Created August 10, 2016 03:24
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 abuiles/bac28d42c800c4dffc4253f66afd0cac to your computer and use it in GitHub Desktop.
Save abuiles/bac28d42c800c4dffc4253f66afd0cac to your computer and use it in GitHub Desktop.
Issue when using for var x in foo
import Ember from 'ember';
export default Ember.Controller.extend({
appName: 'Ember Twiddle',
enumerableProperties: Ember.computed(function() {
let list = [];
for (var x in [1,2,3,4,5]) {
list.push(x);
}
return list;
})
});
<h1>Welcome to {{appName}}</h1>
<br>
<br>
<ul>
{{#each enumerableProperties as |prop|}}
<li>{{prop}}</li>
{{/each}}
</ul>
<br>
<br>
{
"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