I'm trying to have a swipe animation when user swipes left in the device.
Here's a gist of the problem
- When I click on about page button in
Home
page, the app smoothly navigates toAbout
page. - When I hit on back icon button in the top bar of
About
page, it gives a back swipe animation.
I've implemented Hammer.js swipe left gesture for going back but it doesn't show any animation as that of back button animation. How could I achieve that?
I created a working example using StackBlitz to better explain the problem. Could anyone please help?
HTML
<ion-content (swipeleft)="goBack()">
<h2>About page</h2>
</ion-content>
TS
export class AboutPage implements OnInit {
constructor(private location: Location) {}
ngOnInit() {}
goBack() {
this.location.back();
}
}