I am trying to take a json object such as this one:
filters = {"filters": myArray};
and append it to the end of a url using:
this.router.navigate([`/devices/${productType}/${deviceCategory}/${JSON.stringify(filters)}`]);
Anyway, so I read on other forums that using encodeURIComponent should be used so then I tried the following:
this.router.navigate([`/devices/${productType}/${deviceCategory}/${encodeURIComponent(JSON.stringify(filters))}`]);
At this point I dont get errors but, when I try to get the data from params.paramId.filters I get undefined, even if I decode or parse it with JSON.parse(decodeURIComponent(params.paramId.filters));
How can I add a stringified object to a url and then retrieve it from the params to continue using it?
Thank you in advance!