Ionic + Angular UI-Routing: How to delete Back Sta

2019-09-06 18:40发布

问题:

Im working with the Ionic-Framework and AngularJS. If you create the Ionic sidemenu sample project:

ionic start myApp sidemenu

You will get a small example application which shows my exact problem. You can try out the behaviour here: Plunker

If you open up the Side-Menu and navigate to several locations everything is put on the Back-Stack. How can I prevent that behaviour for special pages?

For our example lets say i always want to completely delete the Back-Stack when the "playlists" page is called. My Application will run on mobile devices only and its very untypical to be able to press the back button in the main menu and be navigated to the last opended page.

I want Angular UI-Routing to simulate the Android Backing behaviour.

How can i achieve that?

Another problem is that the hardware back button seems to work different than the back button of the navigation bar. You can see that in the browser. If you navigate to a link from the side menu there wont appear a back button in the navigation bar (Like it should be!). But when you press the browser back button, suddenly a back button in the navigation bar appears (very uncool!). How to prevent that?