Closed eliavmaman closed 6 years ago
Calling dropzone() from the wrapper directiveRef returns the dropzone instance. This is mentioned in the README and there is an example in the example app how to access the directiveref.
i changed my code to
@ViewChild(DropzoneDirective) directiveRef: DropzoneDirective;
this.assetService.addAsset(asset).subscribe(data => {
if (data.success) {
let prop = data.property;
this.directiveRef.config.method='post';
this.directiveRef.config.url = 'http://localhost:3000/properties/property/' + prop._id + '/upload';
this.directiveRef.dropzone.processQueue();
}
});
really dont know what to do... :(
You can't just modify the config of the directive it wont update to the Dropzone. Everything from that point is pure Dropzone so you do exactly like you would do with Dropzone, you use the dropzone instance directly and set its options (if its the way Dropzone is supposed to be used, I am not an expert of Dropzone so don't know how to use the processQueue).
any one can help ?
@eliavmaman,
It's a bit hard to debug without a working example, but I have the feeling the configs are not being passed all the way to the dropzone instance when you modify programatically. You could modify the properties after you get the dropzone instance from the directive.
Have you tried this?
this.assetService.addAsset(asset).subscribe(data => {
if (data.success) {
let prop = data.property;
let dropzone = this.directiveRef.dropzone();
dropzone.options.url = 'http://localhost:3000/properties/property/' + prop._id + '/upload';
dropzone.processQueue();
}
});
i have a form for create user, and i want to save the images of that user after saving user. so i configure autoProcessQeueu =false. in the constructor
i want to manually trigger the processQueue.
How to do that?