I have an iterator and the idea is to create a sub-view (for editions, smoother display etc.). The linkage works as supposed to and the strategy was to fetch the subset of the data upon load of the sub.view component. Due to legal and financial issues, we prefer to provide the already loaded data and feed the sub-view from the super-view instead of from the API.
<div *ngFor="let item of items">
<a routerLink="{{'feature/subview/'}}"
[queryParams]="{origin: ...,data:item}">Click me for {{item.name}}</a>
{{item.this}} and {{item.that}} ...
</div>
I discovered that, although the item values are available to the super-component and render as expected, when the routing occurs, the query string contains the text [Object object] and not the actual serialization of it. How do I force serialization of item that's being passed along in the query string?
Alternatively, should I pass the data using other means than query string? The passed data will always be small, perhaps 1000 characters at the extreme maximum, often below 100 characters, so it made sense to use query strings but I'm open to other approaches, as long as it's not an overkill.