During onboarding users, I have a page with form fields named SignUpPage.
Once the user has onboarded and would like to update their personal information at any point later, they would want to go to a page called UpdateInformation.
SignUpPageFirst and UpdateInformation have exact identical html so it makes sense to use a custom component here to reuse the template in both the pages.
However, the only difference between them is the navigation issue:
During onboarding the user goes from :
SignUpPage ----> ValidateSignUpPage
If the user is already signed in, the user can just go home page after updating the information (from the same form that exists in the SignUpPage) in the UpdateInformation page.
If the user is signed in to the app:
UpdateInformationPage ----> HomePage
The only different between the two pages is how the onSubmit() function in the .ts pages use NavCtrl to push users to the next page.
How can I create a component to reuse the same form in both pages, but then customize the onSubmit() function in each page so as to redirect users to different direction based on what page they are on?