Quantcast
Channel: Ionic Forum - Latest topics
Viewing all articles
Browse latest Browse all 70612

Push to ion-nav only works when done the second time

$
0
0

@kidproquo wrote:

Hello,

I have a ion-nav that inits with a LoginPage:

@App({
template: '<ion-nav [root]="rootPage"></ion-nav>',
providers: [BackendService, FirebaseService, FBService],
config: {} // http://ionicframework.com/docs/v2/api/config/Config/
})
export class MyApp {
rootPage: Type = this._fbService.isLoggedIn() ? TabsPage : Login;
}

The login success callback, pushes the Tabs page:

@Page({
templateUrl: 'build/pages/login/login.html',
})
export class Login {
private nav;
constructor(nav: NavController, private _fbService: FBService) {
this.nav = nav;
}
public loginCallback = (response) => {
this.nav.push(TabsPage);
console.log("logged in");
}
}

The first time I try logging in, the LoginPage does not get replaced by the TabsPage. I do get the console message saying "logged in", but the page still shows the LoginPage. However, if I repeat by trying to log in again, it works - I get to the TabsPage.

Anybody has any idea why this is happening? Any help will be appreciated. Been going crazy with this :slight_smile:

Posts: 1

Participants: 1

Read full topic


Viewing all articles
Browse latest Browse all 70612

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>