Ionic close underlying views

I've developed an Ionic application which works as an online shop. The app opens views like this (in a flow) Start -> Articles -> Cart -> Checkout (-> Credit card payment) -> Order confirmation

When the user presses the back button in the order confirmation view, Ionic goes back to the Checkout (or credit card payment) view. This makes sense for Ionic, but for the user it's weird to go back to checkout when just ordered. How can I close the cart/checkout/cc-payment view that is open underneath the confirmation, so that when pressing the back-button, the user is taken to Articles?

You can use the $ionicHistory service.

With this you can call something like $ionicHistory.goBack(-2) in your controller to take you back 2 views instead of the default one view.