You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Minor enhancement that I think would improve its behaviour. Currently I start the bar if a timer exceeds 300ms, but I always complete it when a state has loaded, but I have to check the .status method to not show it unnecessarily. E.g:
constprogressbarTimeouts=[];// can be more than one, in e.g. a redirect$rootScope.$on('$stateChangeStart',()=>{progressbarTimeouts.push($timeout(()=>progressbar.start(),300));});$rootScope.$on('$stateChangeSuccess',()=>{progressbarTimeouts.map((t)=>$timeout.cancel(t));if(progressbar.status()>0){// <--- wouldn't be needed progressbar.complete();}});
It's a very minor "issue" but I think it makes sense that .complete is a noop if it hasn't started. My code would then be:
constprogressbarTimeouts=[];// can be more than one, in e.g. a redirect$rootScope.$on('$stateChangeStart',()=>{progressbarTimeouts.push($timeout(()=>progressbar.start(),300));});$rootScope.$on('$stateChangeSuccess',()=>{progressbarTimeouts.map((t)=>$timeout.cancel(t));progressbar.complete();});
Thoughts?
The text was updated successfully, but these errors were encountered:
Minor enhancement that I think would improve its behaviour. Currently I start the bar if a timer exceeds 300ms, but I always complete it when a state has loaded, but I have to check the
.status
method to not show it unnecessarily. E.g:It's a very minor "issue" but I think it makes sense that
.complete
is a noop if it hasn't started. My code would then be:Thoughts?
The text was updated successfully, but these errors were encountered: