4

To help transition our app to Angular, we're creating an outer Angular wrapper that dynamically loads server rendered HTML. Using http.get and <div [innerHtml]="result"... in my template works fine for HTML, but it strips <script> tags. I've tried injecting DomSanitizer and using bypassSecurityTrustHtml which then renders the script tags, but still does not execute them.

I found this similar question that loop through the scripts manually and run eval on each, but this still wouldn't load external scripts, eg <script src="...

I know that jQuery's load function will do exactly what I want, but I want to know how to do it with Angular. Is it possible?

0

0

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.