angular-loading-bar
angular-loading-bar copied to clipboard
Prevent loading bar from moving backwards
Following from pull request #119 - this solution seems to work nicely (and caters for the scenario you explained in the PR-119).
Another thing to note is that I fixed the issue where the loading-bar gets removed from the DOM before it has the chance to move through to 100% width.
Lastly (and importantly) - I can't get the unit tests to pass with this change. The 'leave' method of animate returns nothing on line 234 which prevents the status to be set back to 0 (via the '_completeAnimation' function). Could you please assist in getting these tests to run!
Really appreciate the work here! I noticed, however, that subsequent requests end up freezing the loading bar (it no longer ticks randomly). Are you seeing that as well?
Likewise - this is a rad library so I'm happy to help. Hmm... so my test case is the following:
- I fire off one request (1s response time)
- On completion of request I immediately fire off another one (3s response time)
Result: the bar no longer moves backwards but instead carries on moving forwards and finally to 100% when the request returns. FYI I then test distinct requests, which triggers the loading bar to move forward as expected to 100%.
Ok so I'm not getting this freezing behaviour you are experiencing. I'm on Mac testing in Chrome, Firefox and Safari. How exactly are you getting this unwanted freezing behaviour?
+1
+1
+1 @mcoetzee Loading bar doesn't move backward but transition which was fading out loading bar seems to doesn't work with this code. Do you have the same behaviour?
+1 ...
+1
Code works perfectly for me.