I'm using Angular 6. I have a variable named chatConversations
that I add html codes in to it. And in front-side I show data by this code:
<div [innerHTML]="_DomSanitizer.bypassSecurityTrustHtml(chatConversations)"></div>
The problem is in some of HTML codes that I`m injecting into it, I have some click action like :
<span (click)="doSomething">do it</span>
But it does not work when I inject it into the chatConversations
. How can I make functional the (click) elements that I inject into the [innerHTML]?