Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

174
Views
How to build multi step form using routes?
  • Should I use localStorage to store the user input?
  • Should I create a service? Can anyone explain how do I achieve this approach?

For example:

I have 4 routes, each one has a form in it. The last route is going to submit everything.

//1th route 
this.formStepRoute1 = this.fb.group({
  inputRoute1: ['', [Validators.required]],
  radioRoute1: ['', [Validators.required]]
});

//2th route 
this.formStepRoute2 = this.fb.group({
  inputRoute2: ['', [Validators.required]],
});

//3th route 
this.formStepRoute3 = this.fb.group({
  inputRoute3: ['', [Validators.required]],
});

Or should I create a service and build a single form inside of it? How do I populate the user input (and how to keep stored) each time I change the route?

For example:

//Service
    
this.fb.group({
  step1: this.fb.group({
    inputRoute1: ['', [Validators.required]],
    radioRoute1: ['', [Validators.required]]
  }),
  step2: this.fb.group({
    inputRoute2: ['', [Validators.required]],
  }),
  step3: this.fb.group({
    inputRoute3: ['', [Validators.required]],
  })
});
about 4 years ago · Juan Pablo Isaza
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!