Change animation back button

I use these code to change animation from left to right, but It does not work.

ion-navbar color=“pearl” animation=“slide-left-right”

In home.ts, I’ve changed animation with the code below. It’s work properly. How can I apply it to back button ?
this.navCtrl.push(‘ProductPage’, { product: prod }, {animate:true,animation:‘transition’, direction:‘left’});


Try using this code.

import { Component, ViewChild } from '@angular/core';
import { NavController, NavParams, Navbar} from 'ionic-angular';

export class HomePage{
   @ViewChild(Navbar) navBar:Navbar; //define this

      this.navBar.backButtonClick = (e:UIEvent) => {
        this.nav.push(ProductPage,{ product: prod }, {animate:true,animation:‘transition’, direction:‘left’});

Thank @ravi_sojitra, but I mean the back button that ionic auto generate when using .push. Can I apply your code to it ?

1 Like

@ravi_sojitra It works :smiley: . Where can I find document for it ? I have researched but find nothing. How can you know that ?