Skip to content

Instantly share code, notes, and snippets.

@k-fish
Created June 24, 2016 15:35
Show Gist options
  • Save k-fish/d1089ffc3787f0d5558e920342a64f35 to your computer and use it in GitHub Desktop.
Save k-fish/d1089ffc3787f0d5558e920342a64f35 to your computer and use it in GitHub Desktop.
Bound change event
import Ember from 'ember';
export default Ember.Component.extend({
foobar: 1,
actions: {
didChange: function(event){
this.set('foobar' , 'a' + event.target.value)
console.log(event);
}
}
});
import Ember from 'ember';
export default Ember.Controller.extend({
appName: 'Ember Twiddle'
});
<h1>Welcome to {{appName}}</h1>
<br>
<br>
{{outlet}}
{{my-component}}
<br>
<br>
{{yield}}
{{input value=foobar change=(action 'didChange')}}
{
"version": "0.9.3",
"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.5.1",
"ember-data": "2.5.3",
"ember-template-compiler": "2.5.1"
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment