Skip to content

Instantly share code, notes, and snippets.

@sukima
Last active September 27, 2018 18:36
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save sukima/3659f0a1a13d6be0a67319cb164f5cf8 to your computer and use it in GitHub Desktop.
Save sukima/3659f0a1a13d6be0a67319cb164f5cf8 to your computer and use it in GitHub Desktop.
Keydown Example
import Ember from 'ember';
export default Ember.Controller.extend({
actions: {
handleKeyDown(evt) {
console.log(evt);
}
}
});
<h2><code>\{{input}}</code></h2>
{{input
value=foo
key-down=(action "handleKeyDown")}}
<h2><code>&lt;input&gt;</code></h2>
<input
value={{foo}}
onInput={{action (mut foo) value="target.value"}}
onKeyDown={{action "handleKeyDown"}}>
{
"version": "0.15.0",
"EmberENV": {
"FEATURES": {}
},
"options": {
"use_pods": false,
"enable-testing": false
},
"dependencies": {
"jquery": "https://cdnjs.cloudflare.com/ajax/libs/jquery/3.3.1/jquery.js",
"ember": "3.2.2",
"ember-template-compiler": "3.2.2",
"ember-testing": "3.2.2"
},
"addons": {
"ember-data": "3.2.0"
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment