Quantcast
Channel: Active questions tagged javascript - Stack Overflow
Viewing all articles
Browse latest Browse all 140071

click event is not working in innerhtml string angular 6

$
0
0

I am working on an generate dynamic template using angular 6. I have an API that return strings like below:

<button type="button" (click)="openAlert()">click me</button>

and html

<div [innerHtml]="myTemplate | safeHtml">
      </div>

function is bellow:

    openAlert() {
        alert('hello');
      }

Viewing all articles
Browse latest Browse all 140071

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>