title: Angular: Generate hyperlink inside ts file
body: <p>I need to generate a hyperlink in side the component (in .ts file) in side a function using for loop. I know I can do that by using *ngFor loop in the template.
  For example -</p>
  <pre><code>    &lt;div *ngFor=&quot;let rec of item.Records; let k = index;&quot;&gt;
      &lt;a [routerLink]=&quot;['&lt;url&gt;']&quot;
          [queryParams]=&quot;{ id: &lt;itemID&gt;, code: &lt;code&gt;} 
      &lt;/a&gt;
     &lt;/div&gt;
  </code></pre>
  <p>How can I do the same thing inside the .ts file inside a function.</p>
  <p>Thank you in advance.</p>