Skip to content

Instantly share code, notes, and snippets.

@chriskrycho
Last active January 3, 2017 21:13
Show Gist options
  • Save chriskrycho/47fc90561fb8596a522620389873215c to your computer and use it in GitHub Desktop.
Save chriskrycho/47fc90561fb8596a522620389873215c to your computer and use it in GitHub Desktop.
New Twiddle
import Ember from 'ember';
export default Ember.Controller.extend({
appName: 'Ember Twiddle',
someInput: '',
anotherThing: '',
count: 1,
doFoo() {
this.set('anotherThing', this.get('count'));
this.set('count', this.get('count') + 1);
},
blah: Ember.computed('someInput', function() {
this.doFoo();
return `blah that ${this.get('someInput')}`;
}),
});
<h1>Welcome to {{appName}}</h1>
{{input value=someInput change=(mut someInput)}}
{{blah}}
<p>Changed things {{anotherThing}} times</p>
<br>
<br>
{
"version": "0.10.7",
"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.0",
"ember-data": "2.10.0",
"ember-template-compiler": "2.10.0",
"ember-testing": "2.10.0"
},
"addons": {}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment