I am trying to pass a parameter to my routerLink in a loop. Here's 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>
Required output: <a href="page?position=hello"></a>
source share