I have a form that I submit and it is available at any route. If I submit the form, it will then load my component, but when I submit my form twice with different params, my component is not reloaded.
I guess Angular does not load the current component, if it already was loaded, but in this case I actually want that because the user gave new data.
Please do not judge I am not an angular pro.
Some code:
some-form-component.component.ts
(onSubmit is called when submitting the form):
onSubmit() {
if (some-form-component.isFormDataValid(this.formData)) {
this.router.navigate([this.formData.a, this.formData.b, this.formData.c]);
} else {
this.snackBar.open(
'Some error message.',
'OK',
{
duration: 4000,
});
}
}
FullUrl would later be aaa.com/search/a/b/c
for example.