sandbochs / angular-dropzone

AngularJS directive for Dropzone.js
MIT License
43 stars 25 forks source link

how do I use this? #9

Closed ghost closed 8 years ago

ghost commented 9 years ago

I mean, thx so very much for this but I do not know how to use it!

I mean I'd like to do this: http://www.dropzonejs.com/bootstrap.html with your directive, but I do not know how to start!

where and how do I set the event listeners? How to add a preview box? how do I set the action for uploading? thx.

mraaroncruz commented 8 years ago

This module is a very thin directive wrapper for the Dropzone object. This is essentially the guts of the module.

The listeners and config are done in your controller. In the controller and in the template is where you will deal with all of the bootstrappy stuff. Your controller will look a lot like this but without the calls to myDropzone. This will instead be an object (the events object mentioned below).

dropzoneConfig is your config object which is the same as the second argument here.

Your event listeners will be an object where the keys are event names and the values are functions to handle them sent in with the attribute eventHandlers. You can see how this is handled here.

These attributes will be named dropzone-config and event-handlers respectively in the form element you're setting up.

badreal commented 8 years ago

a detailed usage page wouldn't be a luxury :)

ChezFre commented 8 years ago

I've added a pull request for a new readme in case anyone is still having problems after @pferdefleisch's explanation. Don't know if it will be merged since the author doesn't seem very active in this repo.

sandbochs commented 8 years ago

@ChezFre merged your PR. I've been less active here since I spend most of my time in React land these days. Thanks for the README update.