After much searching I am trying to find a simple way to execute a method when clicking a link in dynamically created HTML that is being saved in a database. I'm creating messages to users about transactions that have various links embedded in the message body. I need to save the message on the database and when retrieved and viewed, the user should be able to click a link to call a method which will route them to the proper page.
The HTML looks something like this:
"string myHTML='<div><a (click)=method1(tranID)>Execute Method 1></a><div>
<br><br>
<div><a (click)=method2(tranID)>Execute Method 2></a><div>'
In my HTML file I have:
<div [innerHTML]="myHtml"></div
I understand that this is by design in Angular but there has to be a reasonably straightforward way to do this. I am not an Angular expert and need some help! Thanks