简体   繁体   中英

In ionic app using router-outlet, but hardware back is not working in mobile app

I am using ionic app with for routing, In mobile application while doing hardware back the page is getting struck instead of moving to last page viewed. what can be the issue? I am not getting any console errors

It's a bit complicated to answer this question without any code.. But you can add a simple button to your HTML and set your routerLink. Something like:

<ion-buttons slot="end">
  <ion-button routerLink="/backToPage">
    <ion-icon name="chevron-back-outline"></ion-icon>
  </ion-button>
</ion-buttons>

or like this:

<ion-buttons slot="start">
  <ion-back-button defaultHref="home"></ion-back-button>
</ion-buttons>

... if you have dynamic pages

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM