Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Save evoactivity/5170be528c8c9f2f4bb6b6c8104ba9ac to your computer and use it in GitHub Desktop.
Save evoactivity/5170be528c8c9f2f4bb6b6c8104ba9ac to your computer and use it in GitHub Desktop.
New Twiddle
import Ember from 'ember';
export default Ember.Component.extend({
actions: {
upload(name) {
return new Ember.RSVP.Promise((resolve, reject) => {
Ember.run.later(() => {
alert(`Uploaded ${name}`);
resolve();
}, 100)
});
}
}
});
import Ember from 'ember';
export default Ember.Component.extend({
reset() {
this.set('filename', '');
},
actions: {
upload() {
this.get('action')(this.get('filename')).then(() => this.reset());
}
}
});
import Ember from 'ember';
export default Ember.Controller.extend({
appName: 'Ember Twiddle'
});
{{#file-upload as |upload|}}
{{video-editor action=upload}}
{{/file-upload}}
Filename:
{{input type='text' value=filename}}
<button {{action 'upload'}}>Upload</button>
{
"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