Skip to content

Instantly share code, notes, and snippets.

@iglosiggio
Created February 6, 2017 17:53
Show Gist options
  • Save iglosiggio/3167820e758cfdec1f62a8b814b4897d to your computer and use it in GitHub Desktop.
Save iglosiggio/3167820e758cfdec1f62a8b814b4897d to your computer and use it in GitHub Desktop.
New Twiddle
import Ember from 'ember';
export default Ember.Controller.extend({
appName: 'ember-cat',
cats: [30, 40, 200],
log(thing) {
console.log(thing);
}
});
<h1>Welcome to {{appName}}</h1>
{{#each cats as |cat index|}}
{{input type='range' value=(get cats (concat index)) min=30 max=500}}
{{cat-picture width=(get cats (concat index))}}
<br/>
{{/each}}
<button {{action cats.pushObject '50' target=cats}}>add cat</button>
<button {{action cats.popObject target=cats}}>delet cat</button>
<button {{action log cats}}>log cats</button>
<img src="http://www.cuidatusmascotas.com/wp-content/uploads/2015/04/Por-qu%C3%A9-los-gatos-ronronean.jpg" width={{width}}/>
{
"version": "0.11.0",
"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.10.2",
"ember-data": "2.11.0",
"ember-template-compiler": "2.10.2",
"ember-testing": "2.10.2"
},
"addons": {}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment