I’m having a bit of trouble understanding Ionic’s navigation logic.
I am developing a workflow where users need to add items to a list. The workflow is as follows:
- Start on the list page (page 1).
- Navigate to a selection page and select an item (page 2).
- Customize the item (page 3).
- Return to the list page to see the item added to the list (page 1).
- Repeat as many times as necessary.
The problem is that when I loop through the workflow a second time, my selections from the first time around are cached in the pages 2 and 3. I have created an example to simulate this effect: http://codepen.io/LeviBotelho/pen/myOqja.
Try doing the following:
- Enter 1 in the grey textbox on the first page
- Click “Transition 2”
- Enter 2 in the grey textbox on the second page
- Click “Transition 3”
- Enter 3 in the grey textbox on the third page.
Once you’ve done this, if you click “Transition 1” to return to the first page “1” is still present in the textbox. If you click through to pages 2 and 3, their values are still present as well.
What I would have expected to happen would be to receive a fresh copy of page 1 when I loop back, because I am navigating forward to page 1 with $state.go("1")
. Is this assumption incorrect, and if so, how can I make it such that when I navigate from page 3 to page 1, I get a fresh version?