import Ember from 'ember';
import layout from '../templates/components/profile-upload';

export default Ember.Component.extend({
  layout,

  click(ev) {
    ev.preventDefault();

    this.$(`input`).click();
  },

  getFileFromInput() {
    const file = this.$(`input`).get(0).files[0];

    if (file && file.type.indexOf(`image`) > -1) {

    }
  },

  stopPropagation(ev) {
    ev.stopPropagation();
  }
});

@@ -133,16 +133,69 @@
 ayout,%0A%0A
+  transfer: Ember.inject.service(%60profile-upload%60),%0A%0A
   click(
@@ -338,60 +338,444 @@
 0%5D;%0A
-%0A    if (file && file.type.indexOf(%60image%60) %3E -1) %7B%0A
+    const %7B upload, deserializeResponse, requestError, destroy%7D = this.get(%60transfer%60);%0A    const oldFile = this.get(%60fileUrl%60);%0A%0A    if (file && file.type.indexOf(%60image%60) %3E -1) %7B%0A      if (destroy && oldFile) %7B%0A        destroy(this.get(%60fileUrl%60));%0A      %7D%0A%0A      upload(file).then((response) =%3E %7B%0A        const url = deserializeResponse(response);%0A%0A        this.onchange(url);%0A      %7D, (err) =%3E %7B%0A        requestError(err);%0A      %7D);
 %0A   

Use service to run upload