Use Angular4 features like (click) [src] inside [innerHTML] Angular4

I am using the markdown-it compiler to convert the markup text to html which I display using innerHTML. But the problem is I want to add a function to some specific div and use [src] to display the sanitized youtube url in the iframe.

it shows me an error that the sanitizer stripped some of the code and no javascript functionality works inside [innerHTML].

I heard that the $ compiler was the solution in angularJS. it's still available for ANgular4 and yes how can anyone help me implement it?

Can anyone help me solve this problem?

+3


source to share





All Articles