I did encounter a very strange problem.
When using --prod flag navController.isTransitioning() stays true forever, so that I am unable to use pop().
When compiling without the --prod flag everything is fine.
Is it a known issue?
Any workarounds?
My intention is to remove pages and go back to the previous page. I am using animations for transitions.
I am using ionic-angular 3.8.0, cordova 8.0.0
My code:
public popAndBack(): void {
const previousPage = this.nav.getPrevious(this.nav.last());
this.log.debug(this, "this.nav.isTransitioning() = ", this.nav.isTransitioning());
this.log.debug(this, "this.nav.canGoBack() = ", this.nav.canGoBack());
if (this.nav.canGoBack() && !this.nav.isTransitioning()) {
this.nav.pop();
}
}
public push(targetEnum: NavTargetEnum): void {
if (!this.nullChecker(targetEnum)) {
return;
}
this.nav.push(
this.mapTargetNameToComponent(targetEnum),
{navTarget: targetEnum},
this.getAnimationParams(targetEnum)
);
}
protected getAnimationParams(navTarget: NavTargetEnum): any {
if (navTarget === NavTargetEnum.GOALS) {
return {
animation: this.transitionType,
animate: true,
duration: 200,
easing: "ease-in-out",
direction: "right"
};
}
else {
return {
animation: this.transitionType,
animate: true,
duration: 400,
easing: "ease-in-out",
direction: "left"
};
}
}
Thank you!