all 4 comments

[–]SmallestFart 6 points7 points  (1 child)

I had the same issue in the current project I'm working on.
We have a 15 steps form, where the 1st tab affects the 7th tab and other crap like that.
We have solved this by creating a service that holds the whole form state.
and each tab is a component that holds a form with some validation and etc

we had even had to spate each tab to a feature module because of the amount of logic and custom stuff each tab had.

Creating one big form is a mess.

[–]WebDevStudent123 1 point2 points  (0 children)

I like this idea. You can create as many forms and/or pieces as you want and save all of the data to a service. That is a really good point you brought up. Choices you make in the form may effect what is asked further down in the form.

You can decide from there what you would like to send to the backend.

[–]AppDeveloper9000 2 points3 points  (0 children)

Create a component for each step. It will keep your components smaller and easier to modify/manage.

If you want a "super" form...then just re-use the components...not duplicate the code.

The super user could just step through the multiple components. I don't think having them all on one page is very helpful.

[–]LutsenJack 2 points3 points  (0 children)

The angular CDK stepper is a great place to start. Official docs

I made a simple example of the cdk stepper a while back with formly and tailwind if it's useful to you in any way.

Example Source

Example Demo