Last active
January 20, 2017 20:23
-
-
Save dwickern/c0ab86f1570d5577b60c2e54e04a2bfe to your computer and use it in GitHub Desktop.
input
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import Ember from 'ember'; | |
const DEBOUNCE_MILLIS = 300; | |
export default Ember.Controller.extend({ | |
appName: 'Ember Twiddle', | |
value: 1, | |
displayText: function() { | |
return `current value is ${this.get('value')}!`; | |
}.property('value'), | |
debouncedSetValue(value) { | |
this.set('value', value); | |
}, | |
actions: { | |
changed(e) { | |
this.set('value', e.target.value); | |
}, | |
debounced(e) { | |
// http://emberjs.com/api/classes/Ember.run.html#method_debounce | |
Ember.run.debounce(this, this.debouncedSetValue, e.target.value, DEBOUNCE_MILLIS); | |
} | |
} | |
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{ | |
"version": "0.11.0", | |
"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.10.2", | |
"ember-data": "2.11.0", | |
"ember-template-compiler": "2.10.2", | |
"ember-testing": "2.10.2" | |
}, | |
"addons": {} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment