Skip to content

Instantly share code, notes, and snippets.

@ofridagan
Last active October 23, 2019 06:51
Show Gist options
  • Save ofridagan/d098c66f7e0b18e941d02c9a7a07d3a8 to your computer and use it in GitHub Desktop.
Save ofridagan/d098c66f7e0b18e941d02c9a7a07d3a8 to your computer and use it in GitHub Desktop.
Ember Riddle
import Ember from 'ember';
export default Ember.Component.extend({
count: 0,
items: [],
actions: {
add() {
this.incrementProperty('count');
this.get('items').pushObject(`item #${this.count}`);
}
}
});
import Ember from 'ember';
export default Ember.Controller.extend({
});
<h1>Ember Puzzle</h1>
<br>
<br>
<div>
{{my-list}}
<br>
{{!-- {{my-list}} --}}
</div>
({{count}})
<button {{action "add"}}>Add</button>
<ul>
{{#each items as |item|}}
<li>{{item}}</li>
{{else}}
no items
{{/each}}
</ul>
{
"version": "0.15.1",
"EmberENV": {
"FEATURES": {}
},
"options": {
"use_pods": false,
"enable-testing": false
},
"dependencies": {
"jquery": "https://cdnjs.cloudflare.com/ajax/libs/jquery/3.3.1/jquery.js",
"ember": "3.4.3",
"ember-template-compiler": "3.4.3",
"ember-testing": "3.4.3"
},
"addons": {
"ember-data": "3.4.2"
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment