Problem in popToRoot()

i implement logout functionalitry and in that i set nav.popToRoot() nut when user click on logout button they didn’t redirect to login screen.

code that i used

static doLogout(service:WebService,alertCtrl:AlertController,nav:NavController)
    {
         
        try{
            service.logout().map(res => res.text()).subscribe(
                data => {
                    AllFunctions.closeLoading();
                      nav.popToRoot();
                    });
          }catch(error)
          {
            AllFunctions.doAlert(Constants.error + '- 471',alertCtrl); 
          }
    }

call above function when pressed logout button

I’m having the same issue. Using beta 11.

same here! Any news?

I am using setRoot:

this.nav.setRoot(LoginPage);

But i use event listener to logout:

this.events.subscribe('user:logout', () => {
            this.authenticated = false;
            this.nav.setRoot(LoginPage);
});

Just swapped over to the new RC of Ionic2 and now popToRoot() works like a charm :slight_smile: