Back Button didnt stacked

if i use back button app is closed. back button didnt stacked. where is my problem

App component

My ionic app id : 7f59f520

})
export class MyApp {
@ViewChild(Nav) nav: Nav;
siparisPages: PageInterface[] = [
{
title: “Siparis Olustur”,
name: “SiparisTabsPage”,
component: SiparisTabsPage,
tabComponent: SiparisSatisPage,
index: 0,
icon: “clipboard”
},
{
title: “Sepet”,
name: “SiparisTabsPage”,
component: SiparisTabsPage,
tabComponent: SiparisSepetPage,
index: 1,
icon: “cart”
},
{
title: “Siparis Listesi”,
name: “SiparisTabsPage”,
component: SiparisTabsPage,
tabComponent: SiparisListePage,
index: 2,
icon: “filing”
}
];

stokPages: PageInterface[] = [
{
title: “Stok Sayim”,
name: “TabsPage”,
component: TabsPage,
tabComponent: StokSayımPage,
index: 0,
icon: “md-add”
},
{
title: “Stok Sayim Listesi”,
name: “TabsPage”,
component: TabsPage,
tabComponent: StokListePage,
index: 2,
icon: “ios-archive-outline”
}
];
rootPage: any;
constructor(
platform: Platform,
statusBar: StatusBar,
splashScreen: SplashScreen,
public app: App,
public splitPane: SplitPane,
public menu: MenuController
) {
platform.ready().then(() => {
statusBar.styleDefault();
splashScreen.hide();
this.rootPage = Welcome;
});

}

backToWelcome() {
const root = this.app.getRootNav();
root.popToRoot();
}

logout() {
//Api Token Logout

localStorage.clear();
this.menu.enable(false);
setTimeout(() => this.backToWelcome(), 1000);
this.nav.setRoot(Welcome);

}
openPage(page: PageInterface) {
let params = {};

// the nav component was found using @ViewChild(Nav)
// setRoot on the nav to remove previous pages and only have this page
// we wouldn't want the back button to show in this scenario
if (page.index) {
  params = { tabIndex: page.index };
}

 this.nav.setRoot(page.component, { item: page.index });

}
}

What can i do guys. anyone help me ?

Read the docs about NavController and use

this.nav.push(page.component, { item: page.index });

The comments in the Code u posted just said that…

// setRoot on the nav to remove previous pages and only have this page
// we wouldn’t want the back button to show in this scenario

1 Like

I did not pay attention, sorry about that