SOLVED: Routing on app open best practices & patterns

Hello ionic community.

I’m currently porting a large codebase from ionic 1 to ionic 3

On app open, I have to route to different pages based on conditions from firebase.

What are the best practices and patterns here?

Answer here:

On SO was posted:

You should put your code on app.component.ts. An example:

const authObserver = this.afAuth.authState.subscribe(user => {
    if (user) {
        this.rootPage = 'HomePage';
    } else {
        this.rootPage = 'LoginPage';
1 Like