@Component({ selector: 'my-app', template: ` <div [innerHtml]="html"></div> `, }) export class App { constructor() { this.html = "<h1>DomSanitizer</h1><script>attackerCode()</script>" } }