Skip to content

Instantly share code, notes, and snippets.

@ruz
Created December 3, 2015 17:25
Show Gist options
  • Save ruz/3213fd40aed2c0055799 to your computer and use it in GitHub Desktop.
Save ruz/3213fd40aed2c0055799 to your computer and use it in GitHub Desktop.
action helper as value of onxxx attribute
import Ember from 'ember';
export default Ember.Controller.extend({
appName:'Ember Twiddle',
actions: {
test() {
console.log(arguments);
}
}
});
<h1>Welcome to {{appName}}</h1>
<br>
<br>
{{outlet}}
<input name="xxx" onfocusin={{action "test"}}>
<br>
<br>
{
"version": "0.4.16",
"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.1.0/ember.debug.js",
"ember-data": "https://cdnjs.cloudflare.com/ajax/libs/ember-data.js/2.1.0/ember-data.js",
"ember-template-compiler": "https://cdnjs.cloudflare.com/ajax/libs/ember.js/2.1.0/ember-template-compiler.js"
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment