Skip to content

Instantly share code, notes, and snippets.

@Juraci
Last active September 28, 2016 18:19
Show Gist options
  • Select an option

  • Save Juraci/f2dfc45851bb7d361d652ce4ad91959f to your computer and use it in GitHub Desktop.

Select an option

Save Juraci/f2dfc45851bb7d361d652ce4ad91959f to your computer and use it in GitHub Desktop.
Components
import Ember from 'ember';
export default Ember.Component.extend({
amountOfgames: Ember.computed('games', function() {
return this.get('games.length');
})
});
import Ember from 'ember';
export default Ember.Route.extend({
model() {
return [
{ name: 'Hearthstone' },
{ name: 'Dark Souls' }
];
}
});
<h4>Amount of games found: {{amountOfgames}}</h4>
<ul>
{{#each games as |game|}}
<li>{{game.name}}</li>
{{/each}}
</ul>
{{games-list games=model}}
{
"version": "0.10.5",
"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.8.0",
"ember-data": "2.8.0",
"ember-template-compiler": "2.8.0",
"ember-testing": "2.8.0"
},
"addons": {}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment