Skip to content

Instantly share code, notes, and snippets.

@deanmarano
Created September 8, 2014 20:50
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save deanmarano/ca8ca8ba866a2fcfd9c4 to your computer and use it in GitHub Desktop.
Save deanmarano/ca8ca8ba866a2fcfd9c4 to your computer and use it in GitHub Desktop.
File Input Ember Component
import Ember from 'ember';
export default Ember.Component.extend({
tagName: 'input',
attributeBindings: ['type', 'accept', 'multiple'],
type: 'file',
multiple: false,
initialize: function() {
this.$().on('change', function(e) {
this.sendAction('on-change', e.currentTarget.files);
}.bind(this));
}.on('didInsertElement')
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment