I'm building a loan application site with Angular 7. (think of your usual credit card/home loan application forms. A quick summary of the main features:
- the application has 7 pages (each with one or more child components)
- all pages have validations on the form controls (required, min value etc.)
- the user cannot proceed to the next step/page without completing the current one
This all works fine.
However, the user can also save their application and come back to it later.
What I'd ideally like to do in this case is to be able to go to the first incomplete/invalid page so they don't have to start from the beginning. I can't save application/menu state, only the actual data, so when I open an existing application, I'm thinking I would have to:
- load the pages (form controls) with the data and 'ask' the page if it is valid or not
- if the page is valid, move to the next one
- it the page is not valid, stop there
The issue is that I am not aware of a nice way of doing this - how do I load the data into the form controls and validate them without actually loading the page? Is there any good, general approach I can use for this? Is it even possible?
Thanks!