4
In a hybrid application with Ionic 3 I have 3 pages that are part of the process of buying a product.
The process is as follows:
- The user is in the cart and click on "Choose payment method"
- In case he’s logged is redirected to checkout page
- If you’re not logged is redirected to authentication page
- If it was for authentication and logged in I redirect to checkout
We can imagine a diagram like this:
If you are logged
[CART] => [CHECKOUT]
If you’re not logged
[CART] => [AUTHENTICATION] => [CHECKOUT]
The problem is that if I’m on the checkout after having authenticated and go back to the previous page it goes back to the authentication page and I’d like it to skip it and go back to the cart
I tried numerous variations of the code below unsuccessfully:
// Após autenticar com sucesso
this.navCtrl.push("CheckoutPage").then(() => {
const index = self.navCtrl.getActive().index;
self.navCtrl.remove(index);
});
How can I remove a page from Ionic 2/3 navigation?
It worked perfectly! Thank you.
– Samuel Fontebasso