I have an application where the user fills in a form.
Currently, when the user submits the form, a GET request is sent to the server. The server responds with all the data that matches the user's form criteria. A new component is then loaded.
Code
this.formService.getMyData()
.subscribe(
data => {
this.router.navigateByUrl('/showMyData');
}
);
I'm not doing anything with the data received. I need a way to pass the data to the new component. Does anyone know how that is done?
Example of what I'm looking for
- I fill in a form with the fields 'location' and 'name'.
- I submit the form.
- New component is loaded with a list of all the people who match the location and name I entered previously.
Thanks.