Skip to content

Instantly share code, notes, and snippets.

@Suven
Created December 16, 2016 11:49
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 Suven/5e7d30c69358b5094ae644ddeaf9f947 to your computer and use it in GitHub Desktop.
Save Suven/5e7d30c69358b5094ae644ddeaf9f947 to your computer and use it in GitHub Desktop.
arrayLoop e2.9
import Ember from 'ember';
export default Ember.Controller.extend({
testArray: Ember.computed(function() {
let a = [];
a[5] = 'foo';
a[6] = 'bar';
return a;
})
});
{{#each testArray as |v k|}}
{{k}}: {{v}}<br>
{{/each}}
{
"version": "0.10.6",
"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.9.0",
"ember-data": "2.9.0",
"ember-template-compiler": "2.9.0",
"ember-testing": "2.9.0"
},
"addons": {}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment