Skip to content

Instantly share code, notes, and snippets.

@luxzeitlos
Created September 13, 2016 09:36
Show Gist options
  • Save luxzeitlos/60d3da2fd2653c987ae628432000de1d to your computer and use it in GitHub Desktop.
Save luxzeitlos/60d3da2fd2653c987ae628432000de1d to your computer and use it in GitHub Desktop.
New Twiddle
import Ember from 'ember';
function foo() {
alert(this);
}
export default Ember.Component.extend({
data: 42,
normalFunction() {
alert(this.get('data'));
foo();
},
actions: {
normalAction() {
alert(this.get('data'));
foo();
}
},
});
import Ember from 'ember';
export default Ember.Controller.extend({
appName: 'Ember Twiddle'
});
<button {{action (action normalFunction)}}>
Click the function
</button>
<button {{action 'normalAction'}}>
Click the action
</button>
{
"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