I’m working on an app which has these pages:
Select procedure => Select item => procedure 1 form
Select procedure => Select item => procedure 2 form
When the user completes a procedure, if there are other pending procedures to complete, there’s an option to go directly to that procedure form. Like this:
Select procedure => Select item => procedure 1 form => procedure 2 form
However, I don’t want the user to go back to the previous procedure, because it’s already completed. If he taps back, I want the app to send him back to the Select item screen. I need to remove the last procedure from the navigation Stack.
Now I’m not really looking for advice about how manipulating the history stack is bad design, this is a very specific case in which I really need to do it. This was possible in Ionic 3, you could freely remove pages from the stack. However, in Ionic 4, using Angular routing, I couldn’t find a way to do it. The stack has to be stored somewhere, I just don’t know how to access it. There’s also extra parameters for the Router.Navigate() function that could help me (more specifically, replaceUrl), but they seem to be ignored when using the app on a mobile device. I’ve heard it’s a bug that was fixed in a nighty build, but I don’t want to risk the project with unstable versions, so I’m looking for alternatives. Any ideas?