When using this function, I extract the ids of items and aim to send them as an array for retrieval with getAll().
const queryParams: Record<string, string[]> = selectedItems.reduce(
(acc, curr, index) => ({
...acc,
['item'] : curr.id
}),
{}
);
this.router.navigate(['/goToItems'], {
queryParams
});
I attempted a similar approach but was unable to achieve an array. My goal is to generate something like this:
this.router.navigate(['/goToItems'], {
item: [1, 2, 3, 4, 5] // this array should be queryParams
});
If you have any suggestions on how to implement this, please share them with me. Thank you!