I'm currently working on an ionic-angular app and implementing a Register feature where users input their information step by step. The issue I'm facing is with the backward navigation functionality - when users go back using the arrow button, the previously visited step component doesn't function as expected. It appears the data declared in the ts file properties gets lost, leading to malfunctioning.
My intuition suggests that it's a component lifecycle problem because it might not be resetting properly due to being the most recently opened component.
Here's the code snippet for the back button function:
goBackInNavegation() {
this.router.navigate(['../step2'], { relativeTo: this.activatedRoute, state: {activity: this.activity}}); }
Please disregard the "activity" state object passed along.
Can someone guide me on how to reset the component being navigated to if the previous navigation was from the same step? Any assistance would be greatly appreciated. Thank you :)