I'm trying to pass a parameter to my routerLink within a loop. Here is what the array of objects looks like:
Here is the loop with the routerLink link:
<li *ngFor="let Achievement of AllAchievements">
example from multiple sources
does not work with a variable 'x'. Outputs the letter x
<a routerLink="page" [queryParams]="{x : 1}">anchor text</a>
example from multiple sources
link is outputted /%5B'page',%20%7BAchievement.type%20:%20'hello'%7D%20%5D'
<a routerLink="['page', {Achievement.type : 'hello'} ]">anchor text</a>
outputs long/encoded string as param value
<a [routerLink]="['page']" queryParams="{ [Achievement.type] : 'hello' }">anchor text</a>
</li>
Desired output: <a href="page?position=hello"></a>
[queryParams]
a dynamic value, but the value itself can be dynamic. You may have to rethink your approach. – SpectroscopyqueryParams: {[k: string]: any}
not finding anything about it not capable of being dynamic. – Shoeshinepayload
key, and pass some values from the json in the value, perhaps with a good delimiter. – Spectroscopy