Skip to content

Instantly share code, notes, and snippets.

@baroquon
Created July 8, 2016 02:21
Show Gist options
  • Save baroquon/23d3b7c94ae0a41eb94919e84cce3393 to your computer and use it in GitHub Desktop.
Save baroquon/23d3b7c94ae0a41eb94919e84cce3393 to your computer and use it in GitHub Desktop.
Input Action
import Ember from 'ember';
export default Ember.Controller.extend({
appName: 'Input Action',
actions: {
updateFirstName(){
let firstName = this.get('firstName') || '';
console.log('firstName ', firstName);
}
}
});
<h1>Welcome to {{appName}}</h1>
<br>
<br>
{{outlet}}
<br>
<br>
{{input value=firstName key-press="updateFirstName"}}
{
"version": "0.10.1",
"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.6.0",
"ember-data": "2.6.1",
"ember-template-compiler": "2.6.0"
},
"addons": {}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment