0

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!

  • You can do one thing is that save the form no in your database where user have to start filling the form so when user will come again you can directly display that particular form. – Kishan Mar 13 '19 at 03:59
  • Thanks for the quick reply. Unfortunately, I'm restricted as to what I can change in the database, so saving only the form data (as in the entered values) is all that is possible. – user3769663 Mar 13 '19 at 10:25
  • You can do one thing display form which is invalid so by this way all the valid form will be not in html and invalid form will displayed to user.You can you *ngIf="formReference.form.invalid" on all the form html. – Kishan Mar 13 '19 at 13:12

0 Answers0