Comments (9)
Hi! Could you please clarify a little more? I don't really understand what do you want to achieve.
from angular-evaporate.
Thanks for quick reply! I figured it out in my own way, but I think it should be something simplier and more straightforward:
$scope.ae.$add({
file: file,
started: function () {
console.log('started');
},
complete: function () {
var now = Date.now();
console.log('complete................yay!');
this.$stopped = now;
uploadSuccessCallback(this.$url);
this.$dequeue();
},
error: function (msg) {
var now = Date.now();
this.$errorMsg = msg;
this.$stopped = now;
console.log('Upload #%f failed, msg = %s', this.$id, msg);
uploadFailedCallback(msg);
}
});
because I have to manually set $stopped
and $dequeue
from angular-evaporate.
- The necessity of automatic
$dequeue()
when completed is debatable for me. Probably somebody would want the opposite if we changed this behaviour. - But I'm worried about the
$stopped
and$errorMsg
values. Are you sure they were really undefined before you manually set them? If so, it's definitely a bug, but a strange one, because they're being set right before the custom callback is going to be launched. Could you provide a complete fiddle may be?
from angular-evaporate.
- So I think it will be cool to have it in settings. In your approach you have all uploads in one place, thats why it doesnt make any sense for you do dequeue upload after its finished. But imagine situation when you have tiles on UI showing progresses on each tile. And you want to hide progress bar and do some UI stuff when upload is finished. In that situation it would be cool and makes sense to dequeue upload.
- I'll double check and do fiddle later today or on monday if it doesn't work.
from angular-evaporate.
- Ok, now I got it. You're talking about some new flag, like
$rinserepeat
, for a directive, right? Probably a good idea, worth to be considered at least. I'll tag this thread accordingly and implement it as soon as I have time (unfortunately, not very soon). If you need this right now, then a PR is a good idea, but I guess you don't) - Good.
from angular-evaporate.
- Yeah, I meant it. It would be cool to run some callback on
$dequeue
. - You were right
$stopped
is set on complete and on error, my bad.
I found another issue. I got error 'Error completing upload'. And right after error, complete callback was called. Is that by design? Maybe it make sense to have completed and finished? Because right now I have completed upload but with error 'Error completing upload'...
from angular-evaporate.
Well, the callbacks are fired by Evaporate
itself, whereas AngularEvaporate
just wraps them to implicitly save timestamps, messages and some other similar stuff. So in case of their odd behaviour or to request a new one, it's conceptually better to report an issue there, then implement a custom dependant fix here.
from angular-evaporate.
Btw, why do you need a callback on dequeue
? It's a synchronous operation, so basically you can do whatever you need right after dequeuing. And when it dequeues automatically on complete, you still have a complete
callback.
from angular-evaporate.
Yeah, I do something like that. Wrapping dequeue
in controller function. So maybe this way is better, thanks. Was just curious about to have upload.$dequeue
calling some stuff under the hood.
from angular-evaporate.
Related Issues (20)
- input a directory HOT 1
- HOWTO delay angular-evaporate setConfig() ? HOT 1
- input add files to a list instead of immediately uploading HOT 8
- Drag and drop capability
- Aggregated data and callbacks HOT 1
- callback for 'upload complete' HOT 1
- delete this
- An option to allow only unique files in the queue HOT 1
- pauseAll() non-recoverable HOT 3
- Unresponsive Script - large inputs HOT 7
- Compatability with EvaporateJs 2.0 HOT 2
- $dequeueAll does not clear Evaporate.filesInProcess HOT 2
- How to generate SignerUrl using golang code HOT 1
- Running demo setup is giving CORS error HOT 4
- How to hide secretkey provided on server.js HOT 3
- getting signature mismatch error when trying to sign input request
- Can you help me to get equivalent golang code for server.js code in demo
- Is there any option to get number of bytes uploading HOT 1
- when multiple files are uploading $pauseAll() method is not working HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from angular-evaporate.