Closed Leooo closed 8 years ago
Are you using the latest version? Because Droplet
went through a major refactor lately to make it compatible with Ember 2.0.
If you are, use the hooks
property:
App.XDropletComponent = Ember.Component.extend($window.Droplet, {
url: $window.location.origin + '/upload',
hooks: {
didUpload: files => console.log(files)
}
});
Thanks. Yes I'm using the last version - though with Ember 1.12.1 as ember-listview is not ready yet for Ember 2.0. This seems to work alright, except for the issue https://github.com/Wildhoney/EmberDroplet/issues/91 which prevents overriding the default options - and probably the didUpload hook too (I see nothing logged when customizing the hook for now).
the didUpload
hook properly gets the data.files
object fetched by the server, though it doesn't recognize this
(i.e. the component we are working on), which makes it very hard to work on the data (no access to this.store
, this.sendAction
etc.). I'm talking mostly here about Ember-cli uses, where we are not supposed to use global App.xx
stuff.
@Leooo your issue should be fixed in #100
Hello, I tried to follow https://github.com/Wildhoney/EmberDroplet/issues/26 and your code to access the json callback of the request, with:
but this only sends "undefined", like if the response content was not sent in the callback. Can you explain how to access the response content? Thanks