In your controller you can set a variable that determines the direction of the animation.. So something like this (pseudocode):
$scope.update = function() {
$scope.direction = 1;
}
$scope.backTo = function() {
$scope.direction = 0;
}
In your html you'd surround the areas that are animating:
<div ng-class="{forward: direction, backward: !direction}">
your animated stuff here
</div>
Now just setup your css rules:
.forward .animate-switch.ng-leave{
left:0;
}
/* hide */
.forward .animate-switch.ng-leave.ng-leave-active{
left:-100%;
}
/* show entering slide */
/* hide */
.forward .animate-switch.ng-enter {
left:100%;
}
/* show */
.forward .animate-switch.ng-enter.ng-enter-active {
left:0;
}
.backward animate-switch.ng-leave{
/* etc */
}
Here is a demo from your code pen: http://codepen.io/sbosell/pen/rKJal