Skip to content

Instantly share code, notes, and snippets.

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