@donotsue wrote:
Hi there,
hope you’re enjoying Ionic 4 like I do But I found a question for you on my journey building a little store administration.
It’s a page based (not tab based) app.
Starting simply on the “Homepage”
A click in sidemenu and navigating with
this.navController.navigateForward('/search-products/0')
to pageI got a list here now. Click on an item for an editing formular navigates to
this.navController.navigateForward('/edit-product')
(ID-Transfer of the item solved over services, not over GET-params, so … but this is not the point)Now the excelent working pain: When I “save” the changes on the edit formular of the 3. step above, I needed to get back explicitly to ‘/search-products/1’. This is no problem, when the user clicks on save button and the event handler calls
this.navController.navigateBack('/search-products/1')
(please notice the difference of the first value)Everything nice and dandy But … what, if the user pushs his back button on the phone or the back button in the app or even the browser when
ionic serve
-ing? Then I allthough needed to get “back” to'/search-products/1'
, but this navigation path was not in the above stack …Question: How to do that?
The workaround I used so far
This way I’m using works “excelente”, but it doesn’t feel or even seem to be the right way:
- Again: Starting simply on the “Homepage”
- A click in sidemenu and navigating with
this.navController.navigateForward('/search-products/0')
to pagenow the difference …
- I got a list here now. Click on an item for an editing formular navigates to
this.navController.pop().then(() => { // Going back to Homepage this.navController.navigateForward('/search-products/1').then(() => { // come back with other parameter this.navController.navigateForward('/edit-product').then(() => { // and NOW go to edit formular // do stuff here ... }); }); });
It looks really funny when the pages are changing quickly like an automated bot using the app, but … naaaaah … This is not the right way, I feel that. No other app was acting like this I’ve seen ever before, so … How do I solve this?
Thank you for any help and sorry for the novel I wrote …
Big kisses
Posts: 1
Participants: 1