Han Che Han Che - 1 month ago 24
TypeScript Question

ionic 2 nav push - from right direction

How can I modify the the navPush in a way that new pages enter from the right instead of from the bottom? (there should be some parameters but I didn't find them inside the ionic docs



You can do that by setting the animate property. The only problem is that the push method only could be animated

  • from bottom to top: { animate: true, direction: 'forward' }
  • from top to bottom: { animate: true, direction: 'back' }

You can still use the setRoot() method like this to achieve the animation you're looking for:

this.navCtrl.setRoot(Page1, {}, { animate: true, direction: 'forward' });

Please take a look at this plunker or find more information in this page.