Skip to content

Instantly share code, notes, and snippets.

@k-fish
Created June 23, 2016 18:08
Show Gist options
  • Save k-fish/e8e5bab29289967bb6644e34bd074069 to your computer and use it in GitHub Desktop.
Save k-fish/e8e5bab29289967bb6644e34bd074069 to your computer and use it in GitHub Desktop.
Double bound input example
import Ember from 'ember';
export default Ember.Component.extend({
total: 1000,
actions: {
changedPercentage: function(value) {
console.log('p' + value);
},
changedAmount: function(value) {
console.log('a' + value);
}
}
});
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 onkeyup={{action 'changedPercentage' value="target.value"}} placeholder="percentage">
<input onkeyup={{action 'changedAmount' value="target.value"}} placeholder="amount">
{
"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.6.0",
"ember-data": "2.6.1",
"ember-template-compiler": "2.6.0"
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment