Skip to content

Instantly share code, notes, and snippets.

@SwarnaKishore
Last active August 10, 2017 13:52
Show Gist options
  • Save SwarnaKishore/4f670595b8c3e870c21e2c007b72ed72 to your computer and use it in GitHub Desktop.
Save SwarnaKishore/4f670595b8c3e870c21e2c007b72ed72 to your computer and use it in GitHub Desktop.
Safe pipe
import { Component, OnInit } from '@angular/core';
@Component({
selector: 'my-app',
template: `
<div [innerHtml]="htmlSnippet"></div>
`,
})
export class App {
htmlSnippet: string = "<script>maliciousCode()</script>";
constructor() {}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment