How to conditionally set root page in Ionic 4

I have the same problem and tried doing what’s described here but I’m getting two issues:

  1. There is a slight delay, so I still first see the page that ‘’ redirects to in my app-routing.module.ts
  2. if the root page calls an asynchronous function, the redirect can occur while that is executing in which case the switch to a different page doesn’t happen cleanly, which breaks all sorts of things for me.

In the ionic 3 version of my app, I had this snippet in the app.html under the ion-menu:
<ion-nav [root]=“rootPage” main #content>
and then simply set this.rootPage in app.component.ts and that worked flawlessly. Any idea how I can achieve analogous behavious in ionic 4?

2 Likes