Skip to content

Instantly share code, notes, and snippets.

@runspired
Last active February 23, 2016 16:01
Show Gist options
  • Save runspired/cef7ca20b5cad9730236 to your computer and use it in GitHub Desktop.
Save runspired/cef7ca20b5cad9730236 to your computer and use it in GitHub Desktop.
New Twiddle
import Ember from 'ember';
export default Ember.Controller.extend({
appName: 'Ember Twiddle',
events: [],
actions: {
foo(name) {
this.get('events').pushObject(name);
}
}
});
<h1>Welcome to {{appName}}</h1>
<br>
<br>
{{outlet}}
<br>
<div
{{action "foo" 'mouse-up' on="mouseUp"}}
{{action "foo" 'mouse-down' on="mouseDown"}}
{{action "foo" 'click' on="click"}}
>Click Me</div>
<br>
<ul>
{{#each events as |event|}}
<li>{{event}}</li>
{{/each}}
</ul>
{
"version": "0.6.0",
"EmberENV": {
"FEATURES": {}
},
"options": {
"enable-testing": false
},
"dependencies": {
"jquery": "https://cdnjs.cloudflare.com/ajax/libs/jquery/1.11.3/jquery.js",
"ember": "https://cdnjs.cloudflare.com/ajax/libs/ember.js/2.3.1/ember.debug.js",
"ember-data": "https://cdnjs.cloudflare.com/ajax/libs/ember-data.js/2.3.3/ember-data.js",
"ember-template-compiler": "https://cdnjs.cloudflare.com/ajax/libs/ember.js/2.2.0/ember-template-compiler.js"
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment