Is possible Sanitize on Angular2 a HTML string allowing certaing tags?
问题 I am sanitizing the current html (string value), I want to know if is possible only allow certains attributes. In this example the string only should keep the "id" attribute. Like this: <h1 id="header">DomSanitizer</h1><script>ourSafeCode()</script>'); This is an example of my component. import {BrowserModule, DomSanitizer} from '@angular/platform-browser' @Component({ selector: 'my-app', template: ` <div [innerHtml]="html"></div> `, }) export class App { constructor(private sanitizer: