-
-
Save lsg-vtaran/07dce99a784001bad3e44b4adcec3721 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
//app.component.ts | |
this.trustedHtml = this.sanitizer.bypassSecurityTrustHtml("<h1>html tag</h1><svg onclick=\"alert('bypassSecurityTrustHtml')\" style=display:block>blah</svg>"); | |
//app.component.html | |
<p style="border:solid" [innerHtml]="trustedHtml"></p> | |
//result | |
<h1>html tag</h1> | |
<svg onclick="alert('bypassSecurityTrustHtml')" style="display:block">blah</svg> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment