Here's an example plunker (launch the preview in a separate window to see the history).
- The app starts at state0. History is
/state0.
- Press the button to go to state1. History is
/state0, /state0/state1.
- Press the button to go to state2. History is
/state0, /state0/state1, /state0/state1/state2.
- Press the
Go back button (which uses {location: 'replace'}) to go back to state1. History is now /state0, /state0/state1, /state0/state1, with duplicate /state0/state1.
I think a better behavior is to remove the duplicate state from history when this happens. The current behavior breaks the browser back button (now you have to click back twice to go back to state0).