When I move from A to B I get a right to left animation, this is what I expect.
When I move from B to C I get a right to left animation, this is what I expect too.
BUT when I move from C to A I expect a left to right animation, because I’m moving to a parent state.
What you could do is tap into ionic’s goBack function, which is how they set up the back buttons in the header. But as it seems, that only goes back one view. I’ve never worked with that before so I would not be the best authority on that.
Good question and thanks so much for the well designed sample. It really helps to understand a problem.
I think the problem is that you are expecting Ionic or ui-router to realize intent. However, that link in the third slide is nothing more than a link. It will not convey intent. So, it just sees it as moving forward, hence the right to left transition.
The back button is designed to manage intent. You click it to go back and so it is designed to do that.
NOTE : On the third page, the link is replaced with an ngClick. Sorry it lost the styling. Anyway, it gets the back history and goes to it. However, it only goes back one view as that’s what “back” means.
Nonetheless, I appreciate the fact that the app is trying to guess for us the correct animation, but sometimes it’s just not doable and it would be great having a way (with an html parameter) which may override the standard animation.