Hide splash screen with angular resolves

Hey there,

This helped me time when to hide the splashscreen in my Ionic app. A lot of people try to do it with a $timeout in the .run function of angular, but why not do it in the resolve function of your first controller that’s loaded? :smile:

Hope this helps.

1 Like

This is similar to how my splash is hidden! In my first controller (the login) it submits the authentication if the token is present and then runs the rest of the logic.

I don’t hide the splash unless 1 of 3 criteria are met:

  • Authentication is successful (i switch states and hide the splash at the same time)
  • Authentication is unsuccessful, I ask them to log in then and hide the splash
  • Or they haven’t ever logged in or their auto login is turned off.

It really makes for a beautiful seamless UX!

Thank you for sharing how you do yours.