Sto usando seguente codice per zona di caduta, ma sto errore ottenendo, ho cercato di eseguire il debug, ma io non sono in grado di risolvere questa azione guida plzOttenere Dropzone errore già attaccato alle direttive angolari
http://jsfiddle.net/anam123/rL6Bh/
-------------------> "Error: Dropzone already attached.
throw new Error("Dropzone already attached.");"
Code ::
https://gist.github.com/compact/8118670
snippts:
/**
* An AngularJS directive for Dropzone.js, http://www.dropzonejs.com/
*
* Usage:
*
* <div ng-app="app" ng-controller="SomeCtrl">
* <button dropzone="dropzoneConfig">
* Drag and drop files here or click to upload
* </button>
* </div>
*/
angular.module('dropzone', []).directive('dropzone', function() {
return function (scope, element, attrs) {
var config, dropzone;
config = scope[attrs.dropzone];
// create a Dropzone for the element with the given options
dropzone = new Dropzone(element[0], config.options);
// bind the given event handlers
_.each(config.eventHandlers, function (handler, event) {
dropzone.on(event, handler);
});
};
});
angular.module('app', ['dropzone']);
angular.module('app').controller('SomeCtrl', function ($scope) {
$scope.dropzoneConfig = {
'options': { // passed into the Dropzone constructor
'url': 'upload.php'
},
'eventHandlers': {
'sending': function (file, xhr, formData) {
},
'success': function (file, response) {
}
}
};
});
Dropzone.instances hanno dropzone attatched istanze. Puoi controllarli – uddhab