mpalourdio / ng-http-loader

:dango: Smart angular HTTP interceptor - Intercepts automagically HTTP requests and shows a spinkit spinner / loader / progress bar
MIT License
352 stars 65 forks source link

Hiding spinner when http errors displayed from another http interceptor. #128

Closed chrizy closed 5 years ago

chrizy commented 5 years ago

Hi, In my existing http interceptor, I have some modal popups for things like connection errors, I’m having trouble trying to hide the spinner manually. One solution would be to be able to set the z-order on the spinner so that it will be hidden behind the modal. Or is there a better to do this I’ve tried both setting values on the SpinnerVisibilityService and PendingRequestsInterceptor.

ng-http-loader version - 6.0.1

Thanks

mpalourdio commented 5 years ago

Hi,

I'm not sure to understand. Why does calling SpinnerVisibilityService#hide() does not work in your case ?

chrizy commented 5 years ago

Using that seems to permanently hide the spinner, and doesn't show when the next request starts.

mpalourdio commented 5 years ago

Oh I see, you cannot mix manual and automatic spinner. This use case is not handled.

The other use case (bypassing automatic spinner when show/hide manually) is OK. I guess you need to do some CSS sorcery for this use case, or filtering specific HTTP requests that are performed when your modal is visible.