b**********1 发帖数: 215 | 1 (function() {
'use strict';
function dropzone() {
return function(scope, element, attrs, $log) {
var config = {
url: 'https://www.dropbox.com/home/Pricing%20Tool/Opp%201/Product%
201',
maxFilesize: 100,
paramName: "uploadfile",
maxThumbnailFilesize: 10,
parallelUploads: 1,
autoProcessQueue: true
};
var eventHandlers = {
'addedfile': function(file,$log) {
scope.data.file = file;
if (this.files[1]!=null) {
this.removeFile(this.files[0]);
}
scope.$apply(function() {
scope.fileAdded = true;
});
},
'success': function (file, response) {
}
};
dropzone = new Dropzone(element[0], config);
angular.forEach(eventHandlers, function(handler, event) {
dropzone.on(event, handler);
});
}
angular.module('common.directives.upload', [])
.directive('dropzone', dropzone);
})();
请教如何在 dropzone = new Dropzone; 后,从新获取 file 变量呢? 非常感谢。
BTW,dropzone.js 文件已附上。 |
|