I am looking to create a dynamic hyperlink within the component (in the .ts file) using a for loop inside a function. I understand that this can be achieved by utilizing *ngFor loop in the template. For instance -
<div *ngFor="let rec of item.Records; let k = index;">
<a [routerLink]="['<url>']"
[queryParams]="{ id: <itemID>, code: <code>}
</a>
</div>
How can I implement the same functionality within the .ts file, specifically inside a function?
I appreciate any help you can provide.