Let, I have an URL like below (I am actually getting it by get method)-
/glaccounts/pending_tasks?taskId=2&taskCommand="CreateGeneralLedgerAccount"
this URL resides on an object like this- {activity:"work", taskUI="/glaccounts/pending_tasks?taskId=2&taskCommand="CreateGeneralLedgerAccount"}
Now, how to use that in routerLink? The code below is not working-
<ul class="weekly-weather">
<li *ngFor="let task of pendingTasks">
<a [routerLink]="task.taskUI" [queryParams]="{taskId: '2', taskCommand: 'CreateGeneralLedgerAccount'}">
{{task.activity}}
</a>
<i class="material-icons">call_missed_outgoing</i>
</li>
</ul>
(Note: Here, I am getting an array of objects in pendingTasks)
I have also tried
[routerLink]=[task.taskUI]
[routerLink]=[{{task.taskUI}}]
[routerLink]="{{task.taskUI}}"
[routerLink]={{task.taskUI}}
Last three throw errors obviously. :P