localStorage to store the user input?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]],
})
});