Create Loading for http Request


#1

in ionic 1 i used intercepter for loading in every http request. how can i use loading for every http request at same loading. i can’t find good example. could you please help with this


#2

Put the request logic in its own Service that also includes the Loading stuff, then use the Service instead of dealing with http directly.


#3

I hate disagreeing with mods, but I think services should not be interacting with the view layer, so I would confine the loading to pages that are using the service, instead of trying to offload it onto the service itself.


#4

You and your clean and maintainable code stuff… :stuck_out_tongue:

What if someone wants to have a http variant that always shows and hides a loading indicator when used? Where should this be put then?