Premium support for our pure JavaScript UI components


Post by chrisb »

I'm trying to do the following - but the link just doesn't work.

renderer: ({ record }) => {
        return record?.policies?.map((v) => {
          const policyId = v.policyId || v;

      return `<a [routerLink]="['/deals', '${record.dealId}', 'ops-norms']">
        ${policyId}
      </a>`;
    }).join(', ');
  }

It works fine-ish with a standard href - but I'd rather use the angular router to avoid a page reload.


Post by alex.l »

As far as I know [routerLink] cannot be used dynamically. It's a template syntax.

Please check this https://stackoverflow.com/questions/43613979/how-to-generate-html-elements-with-routerlink-dynamically-in-angular-2

All the best,
Alex


Post Reply