Angular get guards of current route

I have a fairly simple issue but cannot come up with a solution after hours of research. How can I get the guards of the current route?

I have a splash screen service but I only want to hide the splash screen when the user is not logged in. This is because I am sending additional requests that take time to resolve and I want to hide it manually.

There is an external part and an internal part. The internal routes have the AuthGuard. Sure, I could just manually check against all routes in the splash screen service but that would not be maintainable. If the next developer adds another route, he/she may forget to add it to the service. Therefore, I think it would be the most maintainable approach to check against the guards because they will be added for sure.


private _init(): void
    // Get the splash screen element
    this.splashScreenEl = this._document.body.querySelector('#splash-screen');

    // If the splash screen element exists...
    if ( this.splashScreenEl )
        // Hide it on the first NavigationEnd event
                filter((event => event instanceof NavigationEnd)),
            .subscribe(() => {
                // <-------- Check against guard wether or not to hide the splash screen
                setTimeout(() => {

I am open to alternatives but cannot come up with something better.

Source: Angular Questions