I have a simple Loader Service that hides and shows certain loaders. I'm working on something that will be used a lot with slow connections and I need to show/hide a loader between route changes.
I can hide the loader when the new route is loaded with the following.
this._Router.subscribe(() => {
this._LoaderService.hide();
})
I'm trying to find a way that I can call my this._LoaderService.show()
function immediately when any [routerLink] is clicked (at the start of the route change, not the end).
I've had a look around and I tried https://angular.io/docs/ts/latest/api/router/Router-class.html but I can't seem to figure it out.
Any help appreciated