Skip to content

Instantly share code, notes, and snippets.

@locks
Last active August 9, 2016 12:51
Show Gist options
  • Save locks/9533204423dc679d206f to your computer and use it in GitHub Desktop.
Save locks/9533204423dc679d206f to your computer and use it in GitHub Desktop.
Click Closure Action
import Ember from 'ember';
export default Ember.Controller.extend({
appName:'Ember Twiddle',
actions: {
select(arg) {
alert(`nº ${arg}`);
}
}
});
<h1>Welcome to {{appName}}</h1>
<br>
<br>
{{outlet}}
{{my-component select=(action 'select')}}
<br>
<br>
import Ember from 'ember';
export default Ember.Component.extend({
});
<button {{action (action select 1)}}>select</button>
{
"version": "0.4.17",
"EmberENV": {
"FEATURES": {}
},
"dependencies": {
"jquery": "https://cdnjs.cloudflare.com/ajax/libs/jquery/1.11.3/jquery.js",
"ember": "https://cdnjs.cloudflare.com/ajax/libs/ember.js/2.2.0/ember.debug.js",
"ember-data": "https://cdnjs.cloudflare.com/ajax/libs/ember-data.js/2.2.0/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